Note header and footer can be used for the entire page or within an article/section element. A page can have multiple headers and footers in different contexts.
Note There must be only one visible main element per page. It should not be nested inside header, footer, nav, article, or aside. Skip-navigation links typically target main.
main contentprimary contentmain elementpage content
Note An article is a self-contained piece of content that could be independently distributed (blog post, comment, product card). A section is a thematic grouping of content. Both should generally include a heading.
Note aside represents content tangentially related to its parent. When used at the page level it acts as a sidebar. Inside an article, it represents a pullquote or supplementary info.
<details>
<summary>How do I reset my password?</summary>
<p>Go to the login page and click "Forgot Password". Enter your email address and we will send you a reset link within 5 minutes.</p>
</details>
<details open>
<summary>System Requirements</summary>
<ul>
<li>64-bit operating system</li>
<li>4 GB RAM minimum</li>
</ul>
</details>
Note This creates a native collapsible section with no JavaScript needed. The open attribute shows the content expanded by default. Style the summary's marker with ::marker or list-style.
<dialog id="confirmDialog">
<h2>Confirm Deletion</h2>
<p>This will permanently remove the item. Continue?</p>
<form method="dialog">
<button value="cancel">Cancel</button>
<button value="confirm">Delete</button>
</form>
</dialog>
<!-- Open with: document.getElementById('confirmDialog').showModal() -->
Note Use showModal() to open with a backdrop that traps focus (accessible). Use show() for a non-modal popup. The form method="dialog" approach closes the dialog and sets its returnValue to the button's value.
Note Content inside template is not rendered, not visible, and not queried by selectors. It serves as a blueprint for JavaScript-generated elements. Clone its content with cloneNode(true).
templatereusable htmlclone elementhtml template
<time> Machine-Readable Dates
syntax
<time datetime="YYYY-MM-DD">display text</time>
example
<p>Published on <time datetime="2026-03-15">March 15, 2026</time></p>
<p>Event starts at <time datetime="2026-04-10T09:00">9:00 AM, April 10</time></p>
Note The datetime attribute provides a machine-readable format for search engines and tools, while the visible text can use any human-friendly format.
date elementtime elementdatetimemachine readable date