3 ms·
None, but for something that's attempting to generate very simple markup <!DOCTYPE html> <html> <meta charset="UTF-8"> <title>TITLE</title> Is nic
by samarudge 14y ago
None, but for something that's attempting to generate very simple markup
<!DOCTYPE html>
<html>
<meta charset="UTF-8">
<title>TITLE</title>
Is nicer than
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>TITLE</title>
</head>
<body>
</body>
</html>
- libria 14y agoThe <html> is also optional here.[1] <!DOCTYPE html> <meta charset="UTF-8"> <title>TITLE</title> Look at that, I saved you another indent. I think the recent Google Style Guide [2] has made this en vogue, but hipster points for anyone who knew about it before. [1] http://www.whatwg.org/specs/web-apps/current-work/multipage/syntax.html#syntax-tag-omission http://www.whatwg.org/specs/web-apps/current-work/multipage/... [2] http://google-styleguide.googlecode.com/svn/trunk/htmlcssguide.xml http://google-styleguide.googlecode.com/svn/trunk/htmlcssgui...
- huckfinnaafb 14y agoThe character set is also optional if sent as an http header. http://www.w3.org/TR/REC-html40/charset.html#h-5.2.2 http://www.w3.org/TR/REC-html40/charset.html#h-5.2.2 And a supporting talk by paul irish http://paulirish.com/2011/primitives-html5-video/ http://paulirish.com/2011/primitives-html5-video/
- bmelton 14y agoCan I still take the hipster points if I never knew that the second html tag was required? I just always assumed that the new spec rolled the doctype and html declaration into the same thing. Perhaps my HTML5 introduction pitched it that way, or perhaps I just jump to conclusions too easily, but nice to know I've gotten it right, even if only by accident.
- TazeTSchnitzel 14y agoYup. I write all my personal web pages like this now. It's far more efficient, simply because it's less stuff to forget, easier to remember, and much quicker to type.
- bentruyman 14y agoHow often are you actually typing </html>, <head>, and <body> that it actually makes you less efficient? This reminds me of all the ASI discussions that have been going on lately.