HTML5 Semantic Elements Flashcards
Why are their new layout elements?
Indicate the role different parts of the layout play.
Assists with making content more usable for different devices
How are header and footer elects to be used?
They can be used for main header and footer of a page
Also used for header and footer of a section or article
How is the navigation tag to be used?
Use for primary navigation - not for sub navigation
How is the article tag to be used
Used for marking up major content elements e.g. a blogpost, essay, article.
Content that standalone and could be syndicated
How is the aside element to be used
If inside an article, it’s related content not essential to the article
If outside an article its content related to the entire page
What is the section element
It groups related content together
It would include headeings
What role does figure element have
Can be used to mark up any visual accompaniment to an article e.g. video, diagram
must include a caption
What if someone is using an older browser that doesn’t recognise new html5 elements?
You need to specify a rule to set all elements as block level (Other wise they’ll be treated as incline
<code> header, footer, article, section, aside { display: block; } </code>
You can use html5Shiv to create elements using javascript write as a conditional comment