Chapter 8 — Global Attributes, Microdata & The Rest
Beyond specific tags, HTML provides a universal toolkit of global attributes, microdata annotations, character references, and validation tools. This chapter covers the essential “glue” that works on every element – and the legacy relics you must avoid.
What’s Inside This Chapter
- Section 8.1 — Global Attributes: Complete Overview
Universal hooks likeid,class,lang,dir,tabindex,contenteditable,hidden,inert, anddata-*– the attributes you can use on any element. - Section 8.2 — Microdata & Structured Data
How to annotate your HTML with Schema.org vocabularies usingitemscope,itemtype, anditemprop– making your content machine‑readable and ready for rich search results. - Section 8.3 — HTML Entities & Character References
Named entities (<,&) and hexadecimal numeric references (&#xHEX;) – the safe way to display reserved characters and any Unicode symbol. - Section 8.4 — Deprecated Elements & Attributes
A blacklist of obsolete tags (<font>,<center>,<marquee>) and attributes (bgcolor,align) – and their modern CSS replacements. - Section 8.5 — Validation & Developer Tools
Using the W3C Nu HTML Checker to audit your code, and understanding the critical difference between raw source and the live DOM. - Section 8.6 — Global Event Attributes & Why They Are Discouraged
Whyonclick,onload, and similar inline handlers violate separation of concerns, break security policies (CSP), and should be replaced by externaladdEventListenercalls.
START READING
Turn to Section 8.1 and begin with the universal attributes that every HTML element can use.