semantics
1 min read
In HTML, semantics is all about what purpose or role does that HTML element have. There some avantages from writing semantic markup:
Search engines will consider its contents as important keywords to influence the page's search rankings (SEO)
Screen readers can use it as a signpost to help visually impaired users navigate a page
Finding blocks of meaningful code is significantly easier than searching through endless divs with or without semantic or namespaced classes
Suggests to the developer the type of data that will be populated
Semantic naming mirrors proper custom element/component naming
There are roughly 100 semantic html elements. These are some of them.
<article>
<aside>
<details>
<figcaption>
<figure>
<header>
<main>
<footer>
<nav>
<section>
<summary>
<time>