Re: Empty element tags

On Fri, 2012-08-17 at 12:47 -0400, John Cowan wrote:

> Fortunately, no other HTML element has this property.  If you write <meta
> blah-blah-blah></meta>, the close-tag is just ignored.

If you write <img src="foo"></img> you may end up with two img elements
in an HTML DOM, in which case if your CSS has display: block, or
explicit sizing, you'll get an extra vertical space.

You're supposed to use " />" to close any "NULL" HTML element (the space
is required too).

I agree that it's unlikely to be a problem with meta or link elements
inside the head - the first unknown element ends the head, but </meta>
would just generate an empty meta element in the DOM, and that's not
unknown.

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
http://www.holoweb.net/~liam - the barefoot typographer
Co-author 5th edition of "Beginning XML" - Wrox, July 2012

Received on Friday, 17 August 2012 17:36:39 UTC