I mean, aren’t <div/> and <div></div> supposed to be exactly the same thing?
By browser I mean the latest Firefox and Internet Explorer. And by go crazy I mean ignore styles of tags that contain the <div/>.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Only in XML. Are you serving your web page as XML (
application/xhtml+xml)? If so you can use either, but you’d be sacrificing compatibility with IE versions before IE9.If like most people you are serving an XHTML page as
text/html, you must abide by the compatibility guidelines, one of which is that you must only use self-closing tags for elements that have anEMPTYcontent model, ie. the ones where in HTML you’d use a single tag with no close-tag (<img>et al).Otherwise, you’ve just written what non-XML HTML parsers will see as a start-tag with no end-tag, which is likely to mess the page’s nesting up.
<div/>will put the whole of the rest of the page inside that div.