15 cards covering elements, attributes, semantics, and accessibility. Pin anything to keep it visible in the side panel.
Semantic Elements
HTML5 elements that describe what content is, not just how it looks — helping browsers, search engines, and screen readers understand the page structure.
Common tags that go inside <head> to set character encoding, control mobile layout, help search engines, and improve how the page looks when shared on social media.
Setting the right input type does three things automatically: triggers browser validation, shows the correct keyboard on mobile, and displays the appropriate UI control (like a date picker or color wheel).
How to structure a form so it works correctly for keyboard users and screen readers — using fieldset, legend, label, and ARIA attributes to link inputs with their labels and error messages.
html
<form action="/submit" method="POST" novalidate>
<fieldset>
<legend>Personal Information</legend>
<div>
<label for="name">Full Name *</label>
<input
id="name"
type="text"
name="name"
required
autocomplete="name"
aria-describedby="name-hint"
/>
<span id="name-hint">Enter your legal full name</span>
A built-in browser element for collapsible sections — clicking the summary toggles content open or closed with no JavaScript needed.
html
<!-- Native accordion — no JS required -->
<details>
<summary>What is the return policy?</summary>
<p>Items can be returned within 30 days with a receipt.</p>
</details>
<!-- Open by default -->
<details open>
<summary>Currently expanded</summary>
<p>This section is open on page load.</p>
</details>
<!-- Styled with CSS -->
<details class="faq-item">
<summary class="faq-question">
How do I reset my password?
</summary>
<div class="faq-answer">
<p>Click "Forgot password" on the login page...</p>
</div>
</details>
coredetailssummarydisclosure
not reviewed
Accessible Tables
Table markup that screen readers can understand — using caption for the table title, thead/tbody/tfoot to group rows, and scope to tell assistive technology which header belongs to which column or row.
html
<table>
<caption>Q4 Sales Report</caption>
<thead>
<tr>
<th scope="col">Product</th>
<th scope="col">Units</th>
<th scope="col">Revenue</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Widget A</th>
<td>1,200</td>
<td>$24,000</td>
</tr>
<tr>
<th scope="row">Widget B</th>
<td>850</td>
<td>$17,000</td>
</tr>
</tbody>
<tfoot>
<tr>
<th scope="row">Total</th>
<td>2,050</td>
<td>$41,000</td>
</tr>
</tfoot>
</table>
coretablesaccessibilityscope
not reviewed
figure & figcaption
Wraps an image, diagram, or code block together with its caption so browsers and screen readers know the two are related.
html
<!-- Image with caption -->
<figure>
<img
src="diagram.svg"
alt="System architecture diagram showing three tiers"
Built-in browser elements for embedding video and audio — with multiple format fallbacks so different browsers can play what they support, and track files for captions.
html
<video
controls
width="640"
height="360"
poster="thumbnail.jpg"
preload="metadata"
aria-label="Product demo video"
>
<source src="demo.webm"type="video/webm" />
<source src="demo.mp4"type="video/mp4" />
<track
kind="captions"
src="captions-en.vtt"
srclang="en"
label="English"
default
/>
<p>Your browser doesn't support HTML video. <a href="demo.mp4">Download</a></p>
A way to attach custom data to any HTML element using data-* attributes — that data can then be read or changed by JavaScript without affecting how the element looks.
Extra attributes that add or clarify meaning for screen readers — especially useful when native HTML elements alone cannot describe the current state or role of a custom UI widget.
html
<!-- Landmark roles (prefer native elements) -->
<div role="banner">...</div> <!-- use <header> -->
<div role="navigation">...</div> <!-- use <nav> -->
defer and async let the browser download a script in the background while still parsing HTML — the difference is when each script actually runs and whether order is guaranteed.
Tools for serving the right image at the right size — srcset lets the browser pick the best resolution, while picture lets you swap to a completely different image on different screen sizes.
<!-- modulepreload — preload ES module + its dependencies -->
<link rel="modulepreload" href="/src/app.mjs" />
</head>
advancedperformancepreloadprefetch
not reviewed
dialog Element
A built-in browser element for popup dialogs — handles focus trapping (keeps keyboard focus inside the dialog), the dark backdrop overlay, and the Escape key to close, without any JavaScript library.
An HTML block that the browser parses and validates but does not display or run — you clone it with JavaScript and insert copies into the page when needed.
html
<!-- Template is inert — not rendered, scripts don't run -->