Semantic Elements
๐ Semantic Elements in HTML (W3Schools)
๐ Introduction to ARIA (Google)
ARIA can modify existing element semantics or add semantics to elements where no native semantics exist.
semantic element list
#
tag
inline
meaning
1
<main>
โ
there should be at most one main on each page.
2
<section>
โ
generic section of a document.
3
<nav>
โ
navigation part of a document.
4
<article>
โ
independent, self-contained content.
5
<aside>
โ
sidebar.
6
<header>
โ
7
<footer>
โ
9
<time>
โ
date/time.
10
<figure>
โ
annotate illustrations, diagrams, photos, code listings, etc.
11
<figcaption>
โ
provide a caption for the parent <figure> element.
12
<details>
โ
parent container of <summary>, constains additional info.
13
<summary>
โ
A piece of text that when clicked, opens/hides a panel with additional information.
about <details> disclosure marker
Different browsers have their own implementations of how we can deal with the marker for the <details> elements. As W3C hasn't defined a selector for that marker, to disable it, you need to use a proprietary pseudo class :
summary::-webkit-details-marker { display: none; }
You can use that same selector to style the marker differently. Currently, there is no way of animating the open and close.
ARIA Landmark role
role
corresponding element
banner
<header> *๏ธ
navigation
<nav>
main
<main>
complementary
<aside>
form
<form>
contentinfo
<footer> *๏ธ
region
<section>
search
no corresponding HTML5 element.
use role="search"
*๏ธ not contained within other elements
Last updated