[html5] Abbreviated title tags render a blank background?

Ian Hickson ian at hixie.ch
Fri Jul 15 13:26:07 PDT 2011


On Mon, 11 Apr 2011, Nathan Neff wrote:
> 
> I apologize in advance if this question is in a FAQ somewhere or has 
> been asked already on this mailing list.
> 
> I have a simple HTML page that has a blank <title> element that's 
> expressed using <title /> This is probably incorrect/invalid (x)HTML.  

It's correct XHTML, incorrect HTML.


> The issue I have is how certain browsers handle this problem.
>
> For example, Firefox 3 "correctly" renders the body of the html file 
> below.  (For a live example, see 
> http://codewagon.org/title_element.html)
> 
> <html>
>     <head>
> <title />
>     </head>
>     <body>
> If you <br />see this body, you're probably not using Chrome or Firefox 4.
> Chrome and Firefox 4 do not show this text.
>     </body>
> </html>
> 
> Firefox 4 and Google Chrome only render a blank background.

Firefox 4 and Chrome are correct.


> Is this behavior a rule of HTML 5?

Yes.


On Mon, 11 Apr 2011, Jukka K. Korpela wrote:
> 
> As far as I can see (and the parsing rules are somewhat complex, for me 
> at least), HTML 5 prescribes processing of <title> element content as 
> raw text data, so yes. The element is only closed by an explicit 
> </title> tag. If I'm not mistaken, this also applies to XHTML 
> serialization of HTML 5.

The XHTML serialisation of HTML is XML, so only XML syntax rules apply.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the Help mailing list