Line break code <br> </br> <br /> Code (markup): They all work to indicate the line break. But why there are 3 types of codes? What are the differences?
The proper way to define a line-break, according to html standards: <br /> Code (markup): You'll notice the browser will still parse the tag, however any SINGLE html tag requires a /> to distinguish that fact. Another example is the img tag.
You must be kidding, there is no </br> tag. In HTML the <br> tag has no end tag. In XHTML the <br> tag must be properly closed, like this: <br />.
It doesn't on modern browser. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>blah blah</title> </head> <body> <br> <p>Lorem ipsum dolor sit<br> amet, consectetur adipiscing elit.</p> <br/> <p>Lorem ipsum dolor sit<br/> amet, consectetur adipiscing elit.</p> </br> <p>Lorem ipsum dolor sit</br> amet, consectetur adipiscing elit.</p> </body> </html> Code (markup):
</br> Code (markup): Sure works with FF 3.6 It's not true xhtml, but it shows up. You might have to remove your doctype... But that's not the issue here, most webpages are not w3 verifiable, yet they show up fine. Anyway we're discussing the right way to display a line break, not whether or not it will work... and it's been covered. <br /> Code (markup):
The html document should have a doctype. reason 1. otherwise browser process the document in Quirks Mode. reason 2. You will not be able to use a HTML (HyperText Markup Language) Validator to check the page coding. HTML validation requires the DOCTYPE declaration.
Absolutely radiant... But again, why are we talking about this now? It's been covered... I was simply telling you how to get a browser to parse an invalid <br /> (</br>). He has his answer.
1. To make sure to inform that removing doctype is not a good practice. 2. I really missed the second part of your post "But that's ...... I think I need a break .
many of the browsers are very forgiving ive seen some terrible code in the past and wondered how it was possible to display - typically when there is a lot of errors you will see issues when viewing the sites in different browsers particularly mobile sites stick with <br />
LOL Yeah yeah, those kiddies again. Telling "you can remove DOCTYPE"... Okay, then why don't you use Word to "program" your website? Fact is, removing DOCTYPE = BAD (A lot of "php coders" suck in HTML/CSS, I know )
<br /> is fine. It pays to read an entire thread sometimes... Again, i was telling him how to reproduce an error, not suggesting you should not use a doctype. We are quite aware a doctype is necessary. -RC
Why does false (not true as you said) codes works at times? Why </br> acts as <br /> ? are the browsers have auto correction feature or something?
Absolutely. The doctype will also tell the browser how to parse different tags, or in different ways.
@ john smith1 1 + 1 = 2 2 + 2 = 4 Thankyou for your meaningful post that has cleared up what we have been wondering... i love some good SPAM on toast.