[html5] self-closing tags in html5

Stephen Stewart carisenda at gmail.com
Tue Aug 5 05:25:05 PDT 2008


On 5 Aug 2008, at 13:20, Ian Hickson wrote:

> On Tue, 5 Aug 2008, Stephen Stewart wrote:
>>
>> I was reading a presentation on HTML5[1] which included this:
>> ---
>> text/html: boilerplate
>>
>> <!DOCTYPE html>
>> <html>
>> <head>
>>  <meta charset="utf-8" />
>> ---
>>
>> Why is the meta element self-closing? I thought self closing tags  
>> were a
>> product of XML?
>
> In HTML5 we've allowed the / on void elements (like <meta>, <img>,  
> <br>,
> <input>, etc), to ease migration to and from XML.
>
> This is defined here (step 6):
> http://www.whatwg.org/specs/web-apps/current-work/#start
>
> See also:
> http://wiki.whatwg.org/wiki/FAQ#Should_I_close_empty_elements_with_.2F.3E_or_.3E.3F

Perfect, thanks.

Stephen



More information about the Help mailing list