summaryrefslogtreecommitdiff
path: root/Semantic HTML.md
diff options
context:
space:
mode:
authorJasper Ras <jras@hostnet.nl>2025-05-17 09:03:45 +0200
committerJasper Ras <jras@hostnet.nl>2025-05-17 09:03:45 +0200
commitd4bd3ad4a869c87fcfa4f83b42555a6c8e1bc746 (patch)
tree74cbfcd6ff623e272be389dd7d40d8e45d1f96d5 /Semantic HTML.md
parent78211f96953bc1a63570f2430cee4ad92c841ce4 (diff)
vault backup: 2025-05-17 09:03:45
Diffstat (limited to 'Semantic HTML.md')
-rw-r--r--Semantic HTML.md16
1 files changed, 13 insertions, 3 deletions
diff --git a/Semantic HTML.md b/Semantic HTML.md
index cc4a892..04b9059 100644
--- a/Semantic HTML.md
+++ b/Semantic HTML.md
@@ -9,11 +9,21 @@ The browser builds an **AOM** (Accessibility Object Model); it uses semantic ele
### Roles
Defined by [ARIA](https://w3c.github.io/aria/#dfn-role). All elements can have a `role` attribute, sementic elements have it implicitly.
-For example used by screenreaders.
+Roles give meaning to elements, so it's useful to use directly if we can't find any existing semantic element and just a div instead.
-`<header>` and `<nav>` are semantic landmarks. Landmarks are the main sections of a webpage. A `<header>` not in the top-level is no landmark; it is the header of a section. Same goes for the `<nav>`, it is only a landmark if it is inside the top-level `<header>`
+### Document Structure
+`<header>` and `<nav>` are semantic landmarks.
+Landmarks are the main sections of a webpage.
+A `<header>` not in the top-level is no landmark; it is the header of a section. Same goes for the `<nav>`, it is only a landmark if it is inside the top-level `<header>`. Also `<footer>` is a landmark if it is a top-level element.
-Don't use too many "landmark" roles; it creates noise for screenreaders and makes it difficult to understand the structure.
+Footers often contain contact information or copyright etc.
+
+Main: 1 per page; main contnet
+Aside: tangentially related content; complementary
+Article: represents a completely standalone piece of content, reusable.
+Section: Used if no more specific element exists; should have a heading most of the time.
+
+Don't use too many landmarks; it creates noise for screenreaders and makes it difficult to understand the structure.
Headings: `<h1>` go until h6. Site header if nested in top-level header element. Page header if nested in main element. Subsection header if nested in section or article.