Code must follow good semantic practices
HTML semantics are important. They don't just play a key role in making the Web look the way it does, they have a function in accessibility, SEO, and even in sustainability. Ensuring that you markup your content correctly and avoid cluttering your markup wastefully will reduce emissions.
Criteria: Semantic code
Content must be accurately marked up according to the relevant standard(s).
Resources
- 0.5% of the Global Top 200 Websites Use Valid HTML
- Every HTML Element
- GPF - General Policy Framework (PDF) - 1.9 - Strategy (Interoperable Technologies)
- GPF - General Policy Framework (PDF) - 4.5 - UX and UI (Native Components)
- GR491 - 1-4006 - Information Over Presentation
- How Often Should We Speak About HTML Conformance?
- HTML: A good basis for accessibility
- HTML5 For Web Designers
- Is React Accessible? That's the Wrong Question
- Jumping HTML tags. Another reason to validate your markup
- Mastering HTML
- Page bloat update
- Plain Vanilla
- Reducing Carbon Emissions On The Web
- Semantic HTML
- Semantic HTML: the foundation of web accessibility
- Ten years of page bloat: What have we learned?
- Testing 10 JavaScript Frameworks on Their HTML Defaults
- The Carbon Impact of Web Standards (PDF)
- Understanding why Semantic HTML is important, as told by TypeScript
- United Nations SDGS - Goal 1 - Poverty
- W3C Validator
- Web Accessibility Lawsuits
- Web Standards: The What, The Why, And The How
- What is page bloat?
- Where Has All the Valid HTML Gone
Criteria: Optional features
Remove optional HTML tags, attribute quotes, and default attributes only when they do not negatively impact functionality, accessibility, or readability. Retain them when they enhance accessibility, maintain clarity (without compromising on performance), or ensure consistent browser rendering.
Resources
Criteria: Avoid non-standard code
Avoid using non-standard elements or attributes.
Resources
Criteria: Custom code
Human-testable
Prefer using standard HTML elements and attributes. Only use custom elements or Web Components if you cannot utilize native HTML elements or if you need tightly regulated control over the implementation of design system components..
Resources
Impact: Medium, Effort: Medium
GRI | Impact |
---|---|
materials | Medium |
energy | Medium |
water | Medium |
emissions | Medium |
Benefits of this guideline
- Environment: Sites with bloated markup waste data, also sites with broken markup could trigger memory leaks (performance issues) in apps, and following standards ensures sites will work the same across devices and platforms (reducing bugs, developer fix time, and resource waste).
- Accessibility: Semantic HTML is a great stepping stone towards making your content easier to navigate by assistive technologies. Many tags within HTML come with pre-loaded context about what is expected within them (reducing the need for ARIA or other descriptive features). This can also help browsers, search engines, social networks, and other "blind" technologies understand your websites or applications better. This can help you reduce barriers in terms of content navigability.
- Performance: Deprecated code isn't optimized within rendering engines, and while Web components do outperform framework components, they won't beat the native HTML elements they build upon.
- Economic: Inaccessible sites can lead to lawsuits, avoiding these is beneficial to any website owner.
- Conversion: Poorly coded sites may break features for visitors, leading to website abandonment.
Example
-
code
-
content
Semantic HTML5 Elements Explained.
Tags:
- Accessibility
- Compatibility
- Content
- HTML
- Social Equity
- Usability