On 25 April 2010 22:53, Mark Mielke <m...@mark.mielke.cc> wrote: > On 04/25/2010 04:44 PM, Eric Brine wrote: >> The combined open close tags such as <hr/> should be used with a >> space before the / to make sure it works on old and new browsers. >> >> Try: <hr /> >> >> >> That's not valid HTML. > > What is invalid about it? The "/" gets interpretted as an unrecognized > attribute. Do you mean formal HTML without support for extensions via new > attributes? Which HTML or XHTML parsers do you know that will break with <hr > />?
Does the w3 validator count? The HTML strict validator treats <hr /> as an error: http://validator.w3.org/check?uri=http%3A%2F%2Fwww.doc.ic.ac.uk%2F~pgp%2Fwrong-s.html The HTML transitional validator throws up a warning for <hr />: http://validator.w3.org/check?uri=http%3A%2F%2Fwww.doc.ic.ac.uk%2F~pgp%2Fwrong-t.html The reason is explained here: http://www.cs.tut.fi/~jkorpela/html/empty.html tl;dr version: <hr /> in HTML means <hr>> -- that is, an <hr> tag followed by a greater-than sign. Almost no browser displays it this way; but HTML validators *do* interpret it this way. If anything, using <hr/> to mean <hr> is a nonstandard but common extension. I'm not sure if <hr/> will induce quirks mode in browsers. Phil