Others include <img="" />, <br />, <hr /> and <input ="" /> I think it stemmed from Netscape incompatibilities.
Actually Scott it is either <br> or <br /> The XHTML above is equivalent to: XHTML - Hello World <br> Bye <br> or XHTML - Hello World <br /> Bye <br /> As another poster explained all tags in XHTML (like XML) must close. If it is a unary tag (e.g. img, hr, or link) you add the slash at the end so the browser (if it really cares that it is proper XHTML or XML) will know not to expect a closing tag. Also note </br> is not the same as <br />. </br> is a closing tag while <br /> is a self-closing tag. "<br></br>" is valid for XML but might be invalid for XHTML but definately redundant since it is sytntactly equivalent to "<br />" I don't know if this helps clear things up but explaining things another way sometimes helps.
Hey is it too late to bring this up again? I just want a little confirmation here so I don't end up making a broad assumption. I fully understand DOC Types and I fully understand that XHTML is XML rendered as HTML but what I want to know is this; ARE THESE XHTML Compliant or not? Its my belief they are not. <br> <b><b/> <i></i> Oh and before you nail me for not reading the above posts, I in fact did, but found just a few points people made less than convincing while the one from Gary the most convincing. ~ J
XHTML Compliant? 99% of "xhtml" pages are sent as text/html so they really *are* HTML and it doesn't matter if you use <br /> or <br> because the browser is lenient. If you're talking about w3 validation, if you're using XHTML Transitional I do believe you can freely use <b> and <i>, but will probably get an error saying you need to close the <br>, with a / so it would be <br />. If you're using XHTML Strict then I do believe you will get an error since these were deprecated in XHTML Strict (B, I and other elements).
<br> is invalid, <b></b> and <i></i> are deprecated (but may be re-introduced soon with a more defined semantic meaning). Use <br />, <strong></strong> and <em></em>
Thank you for just verifying what I knew. Now I can boldly write in my blog on a subject I've been holding off on so I don't look ignorant for suggesting that the correct method of XHTML Strict is to use <br />, <strong></strong> and <em></em>
Already been explained pretty well. I used to use <br> alone. Now I use <br /> for line breaks, self closing as mentioned. I think you should use that if any.