Do Html5 elements Aside & Nav need a header?
In HTML5 drafts, there is no requirement or recommendation that a nav
or aside
element shall or should have a heading. Neither is there any prohibition against headings in them.
What is “ok practice” is really a matter of opinions, with no solid basis to judge it on. The outline algorithm is rather theoretical and has got little attention from browser vendors or search engine vendors. It may be useful as authoring and maintenance tool, or an algorithm used by such tools.
Structuring HTML5 content - listView, header, footer and menu - with semantic tags
It's not wrong.
<article>
is slightly better, but list semantics and a heading (h[1-6]
) element will be more useful to everyone and probably suffices.Yes.
Directly use
<header>
. You sample markup is fine, except that your<nav>
section appears to contain no links.Yes.
You can. I can't comment on SEO.
Warning. W3Schools is not a good web site and the page on the sectioning elements is typically clueless. While their pages can sometimes provide an easy to follow introduction to a subject, treat nothing you read there as gospel.
Confusion about HTML5 section, article and aside element compared to div element
The answer is: it doesn't really matter much, apart from code readability. Please see Why use HTML5 tags? for more on that.
You could have a <section class="articles">
that contains all <article>
elements. You could have a <div class="articles">
that contains all <div class="article">
elements. I think it's safe to say there's no doubt the first one is easier to read for developers. Your pick.
There is, however, one issue: you self-close <img>
-- no need for that in html5 anymore. See Are (non-void) self-closing tags valid in HTML5?.
In HTML 5,
<foo />
means<foo>
, the start tag. It is not a "self-closing tag". Instead, certain elements are designated as having no end tag, for example<br>
. These are collectively called void elements. The slash is just syntactic sugar for people who are addicted to XML. Using the slash in a non-void element tag is invalid, but browsers parse it as the start tag anyway, leading to a mismatch in end tags.
Related Topics
How to Vertically Align Text Inside a Flexbox
Can HTML Checkboxes Be Set to Readonly
Best Practices & Considerations When Writing HTML Emails
How to Apply a Style to an Embedded Svg
Make Footer Stick to Bottom of Page Correctly
How to Get HTML 5 Input Type="Date" Working in Firefox And/Or Ie 10
Do You Put Schema Microdata Meta Tags in the HTML Body
How to Assign Multiple Classes to an HTML Container
Properly Sizing and Aligning the Flex Item(S) on the Last Row
Flexbox Fill Available Space Vertically
Difference Between Id and Class in Css, and When Should I Use Them
Scraping HTML Tables into R Data Frames Using the Xml Package
How to Add a New Line in Textarea Element
How to Wrap Text Around a Bottom-Right Div
How to Escape Ampersands in Xml So They Are Rendered as Entities in Html
Col-Xs-*' Not Working in Bootstrap 4