Re: Empty element tags

On 17/08/2012 18:36, Liam R E Quin wrote:
> 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).

For html systems using the parsing algorithm in the html(5) spec </img>
will be ignored and /> is always treated as > (but is a validation error
for elements not classed as null) no space is required before /> (and
any space there is ignored)

David

Received on Friday, 17 August 2012 17:42:19 UTC