3 ms·
You don't even need <html>. <https://html.spec.whatwg.org/multipage/semantics.html#the-html-element https://html.spec.whatwg.org/multipage/semantics.html#the-ht
by skymt 6y ago
You don't even need <html>. <https://html.spec.whatwg.org/multipage/semantics.html#the-html-element https://html.spec.whatwg.org/multipage/semantics.html#the-ht...>
This is a valid HTML5 document:
<!doctype html>
<title>This is valid!</title>
<p>Really, it's valid!
Paste it into the validator yourself if you don't believe me: <https://validator.w3.org/nu/#textarea https://validator.w3.org/nu/#textarea>
- jhgb 6y agoWow, I didn't actually know that. That feels...so dirty!
- tannhaeuser 6y agoThat's SGML tag inference at work (theoretically at least, since browsers have HTML parsing rules hardcoded). SGML knows, by the DOCTYPE declaration, that the document must start with an "html" element, so it infers it if it isn't there. Next, by the content model declared for the "html" element (normally obtained via the ugly public identifier that sibling comments complain about), a "head" element is expected, so SGML infers it as well if it's declared omissible, and so on.
- masswerk 6y agoIn the "old days", web pages were often just the bare content (no html, head, body containers, no DOCTYPE declaration). A few sites also featured just the body tag (and respective content) for setting the background attribute for the page background color. E.g., this is the entire code of Netscape's first home page: <TITLE>Welcome to Mosaic Communications Corporation!</TITLE> <CENTER> <A HREF="MCOM/index2.html"><IMG SRC="MCOM/images/mcomwelcome1.gif" BORDER=1></A> <H3> <A HREF="MCOM/index2.html">Click on the Image or here to advance</A> </H3> </CENTER> http://home.mcom.com/ http://home.mcom.com/
- dheera 6y agoI LOVE <center> and still use it sometimes because it's too goddamn complicated to center anything days. "margin-left:auto;margin-right:auto;" what the F??? "width:500px;margin-left:-250px;left:50%;" what the #$#$@? Are they kidding?