AFAIK they're not optional, just implied. So if you leave them out, the browser still inserts them by guessing where they should be. In the same way, closing tags are also implied, you can just not write them and the browser will figure it out.
I've never bothered with the viewport device width stuff. I don't have an iDevice. But I'm sure Apple will adopt sane defaults any week now, so it will all be obsolete.
It isn't just for iDevices, it's for any mobile device. Without it, the page will default to a zoomed out emulated desktop-sized screen. If you don't test mobile sizes you shouldn't add it, but if you do you should.
hoistbypetard | 12 hours ago
This author is mere moments away from writing their own SSG to expedite the boilerplate, now.
singpolyma | 13 hours ago
Note that with html5 the html and head tags are optional again
fx | 2 hours ago
AFAIK they're not optional, just implied. So if you leave them out, the browser still inserts them by guessing where they should be. In the same way, closing tags are also implied, you can just not write them and the browser will figure it out.
bentley | 10 hours ago
The html and head tags (and body too) have been optional in every version of HTML not named XHTML.
skobes | 9 hours ago
Omitting <body> is a bit risky in my opinion because inline script may see document.body == null.
recursive | 12 hours ago
I've never bothered with the viewport device width stuff. I don't have an iDevice. But I'm sure Apple will adopt sane defaults any week now, so it will all be obsolete.
easrng | 11 hours ago
It isn't just for iDevices, it's for any mobile device. Without it, the page will default to a zoomed out emulated desktop-sized screen. If you don't test mobile sizes you shouldn't add it, but if you do you should.