This is the final, and most bizarre step of the HTML to XHTML 1.0 transformation. But it's not so mysterious if you know the background. We've told you XHTML is stricter than HTML, and one area where it is stricter is with closing tags. In HTML, you can have an empty element without a closing tag. But in XHTML, if you aren't going to have a closing tag, you have to tell the browser about it by putting a slash before the final ">". So, take the <br> element as an example. In HTML we just write <br>. But in XHTML, we write <br/>. That little slash on the end tells the browser it shouldn't expect a closing tag, because the <br/> is all there is. Now you might have noticed we didn't include a space before the "/>". That's because XHTML doesn't require it. However, some older browsers can't recognize "/>" without a space before the slash, so, to be backwards compatible, just put a space before your slash in " />". |
||||||
Disclaimer
1) E-articles is not responsible for the information contained by this article as well for any and all copyright infringements by authors and writers. E-articles is a free information resource. If you suspect this article for any copyright infringement, please read the terms of service and contact us to investigate the problem.
2) E-articles is not responsible for inaccuracies, falsehoods, or any other types of misinformation this article may contain and will not be liable for any loss or damage suffered by a user through the user's reliance on the information gained here. link to this article |