3 ms·
That doesn't have to be on the html element though, it can be on another element if so desired.
by SahAssar 7y ago
That doesn't have to be on the html element though, it can be on another element if so desired.
- chrismorgan 7y 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 7y agoAgreed, was just saying it does not have to be on <html> since I did not know that before checking MDN after your comment.