• We've upgraded our forums. Please post any issues/requests in this thread.

what is the difference between <br> and <br /> tag

rakkhi

New Member
Joined
Jan 24, 2011
Messages
4 (0.00/day)
Likes
0
#1
Can any one tell me what is the difference between <br> and <br /> tag.
 

scooper22

New Member
Joined
Jan 12, 2011
Messages
108 (0.04/day)
Likes
30
Location
Central Europe
Processor HDT90ZFBGRBOX (uv, oc)
Motherboard 90-MXGIP0-A0UAYZ
Cooling VENOMOUS-X + TR-FDB-12-600 + PLPS
Memory F3-12800CL9D-8GBSR2
Video Card(s) 21188-00-40R + DCACO-V3400-BLA01 (uv, unlock)
Storage WD10EALS-00Z8A0 + 4044951000029
Display(s) VM633AT
Case FT02B-W
Audio Device(s) SB0090, ALC892
Power Supply BN162
#2
The first is a tag from HTML, the second is from XHTML (the shorttag version of "<br></br>")
Read up here: http://www.w3schools.com/XHTML/xhtml_html.asp

Also is is very important to set your document's DOCTYPE to the language you're using, HTML is not the same as XHTML, HTML3 not the same as HTML4, "HTML 4.01 Transitonal" not the same as "HTML 4.01 Strict" and so on! Otherwise you'll get "guesswork" from the browser! This is very important!
More here: http://www.w3schools.com/tags/tag_doctype.asp

Use this validator to see if you made errors in your page (browsers should actually reject these with a "syntax error"): http://validator.w3.org/
 
Last edited:

FordGT90Concept

"I go fast!1!11!1!"
Joined
Oct 13, 2008
Messages
20,922 (6.24/day)
Likes
10,023
Location
IA, USA
System Name BY-2015
Processor Intel Core i7-6700K (4 x 4.00 GHz) w/ HT and Turbo on
Motherboard MSI Z170A GAMING M7
Cooling Scythe Kotetsu
Memory 2 x Kingston HyperX DDR4-2133 8 GiB
Video Card(s) PowerColor PCS+ 390 8 GiB DVI + HDMI
Storage Crucial MX300 275 GB, Seagate 6 TB 7200 RPM
Display(s) Samsung SyncMaster T240 24" LCD (1920x1200 HDMI) + Samsung SyncMaster 906BW 19" LCD (1440x900 DVI)
Case Coolermaster HAF 932 w/ USB 3.0 5.25" bay
Audio Device(s) Realtek Onboard, Micca OriGen+
Power Supply Enermax Platimax 850w
Mouse SteelSeries Sensei RAW
Keyboard Tesoro Excalibur
Software Windows 10 Pro 64-bit
Benchmark Scores Faster than the tortoise; slower than the hare.
#3
<br> is HTML 4.01 is Loose and Transitional compliant.
<br /> is HTML 4.01 Loose, Transitional, and Strict compliant.

The reason for the ending slash is because in XML, all tags must be closed. <br> is considered an opening tag and so is <img>. <br /> and <img /> tells parsers there is no ending tag. An XML interpreter would see <br> and look for a </br> which doesn't exist in the markup.

<br /> is considered "proper."
 
Last edited: