Forum Moderators: open
<img src"=..." alt="" />
<hr />
<br />
etc...
So, I'm perusing the W3C specs to figure out what to do with a <param> tag that I'm getting errors on, and guess what I see?
Empty elements must either have an end tag or the start tag must end with />. For instance, <br/> or <hr></hr>. See HTML Compatibility Guidelines for information on ways to ensure this is backward compatible with HTML 4 user agents.CORRECT: terminated empty elements
<br/><hr/>
INCORRECT: unterminated empty elements
<br><hr>
What gives?
ADDED: Since the leading white space is irrelevant in terms of validation I think the distinction is meaningless in terms of adherence to the standards. Both methods will validate in all the validation checkers I've ever used.
application/xhtml+xml, then you should use the version without the space. The space is required when serving the markup to legacy browsers with the mime type text/html, as some older browsers crash when encountering the version without the space. When you leave a gap and serve the file as
text/html, the slash is considered by the parser as an invalid attribute and discarded.