5 ms·
<html> should be included so you can hang your lang=en (or whatever) off of it.
by edflsafoiewq 6y ago
<html> should be included so you can hang your lang=en (or whatever) off of it.
- SahAssar 6y agoThat doesn't have to be on the html element though, it can be on another element if so desired.
- chrismorgan 6y agoA lang attribute only affects the element it’s applied to, and any descendants. Putting it on the html element is the most robust way of indicating this. I’d rather not write this: <!doctype html> <meta charset="utf-8"> <link lang="en" title="All blog posts feed" rel="alternate" type="application/atom+xml" href="feed.xml"> <title lang="en">Blog posts</title> <body lang="en"> … I’d rather just do it once: <!doctype html> <html lang=en> <meta charset=utf-8> <link title="All blog posts feed" rel=alternate type=application/atom+xml href=feed.xml> <title>Blog posts</title> …
- SahAssar 6y agoAgreed, was just saying it does not have to be on <html> since I did not know that before checking MDN after your comment.