Try this → Create a book title, chapter title and subsection using h1, h2 and h3.
Paragraphs
Paragraphs
A p element groups a paragraph. Use separate paragraphs rather than repeated line breaks.
<p>Alice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do.</p>
<p>So she was considering in her own mind.</p>
Edit HTML
Try this → Add a third paragraph.
Links
Links
href gives the destination. Descriptive link text tells readers where a link leads. This preview demonstrates an in-page link.
<a href="#chapter">Read the chapter</a>
<h2 id="chapter">Down the Rabbit-Hole</h2>
Edit HTML
Try this → Change the ID and update the matching href.
Images
Images
src points to an image; alt describes its purpose. Use alt="" for purely decorative images. This sample uses an embedded SVG so it works offline.
<img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='120'%3E%3Crect width='300' height='120' fill='%23ff1493'/%3E%3Ctext x='20' y='80' font-size='64'%3EAa%3C/text%3E%3C/svg%3E" alt="Large black Aa letterforms on a pink background" width="300" height="120">
Edit HTML
Try this → Write a shorter alternative description that preserves the meaning.
Lists
Lists
ul groups unordered items; ol gives a numbered sequence. Each item belongs in li.
<ul>
<li>HTML: structure</li>
<li>CSS: appearance</li>
</ul>
<ol>
<li>Write the markup</li>
<li>Style the text</li>
</ol>
Edit HTML
Try this → Change the ordered list into your own three-step workflow.
Divs
Divs
A div is a neutral grouping element. Use it when there is no more meaningful HTML element.
<div class="book">
<h2>Alice in Wonderland</h2>
<p>Lewis Carroll</p>
</div>
Edit HTML
Try this → Add a second book group.
Sections
Sections
A section groups related content and should usually have a heading.
<section>
<h2>Chapter one</h2>
<p>Down the Rabbit-Hole</p>
</section>
Edit HTML
Try this → Add another section with its own heading.
Semantic elements
Semantic elements
header, nav, main, article and footer describe their roles. Use one visible main landmark per page.
Classes can repeat. An ID must be unique in the document and can be a link destination.
<h1 id="title" class="display">Alice</h1>
<p class="display">Down the Rabbit-Hole</p>
Edit HTML
Try this → Add a CSS editor rule in your own file that targets .display.
Linking CSS
Linking CSS
Put link in the document head. href is relative to the HTML file. The preview uses an inline equivalent; create css/style.css when copying this into a project.
<!-- In the head of your own file: -->
<!-- <link rel="stylesheet" href="css/style.css"> -->
<h1>Alice</h1>
Edit HTML
Try this → Uncomment the link in your project and create the matching stylesheet.
Linking JavaScript
Linking JavaScript
A script with defer waits for the document to be parsed before running. Keep the external path relative to your HTML file.
<!-- In your own document head: -->
<!-- <script src="js/script.js" defer></script> -->
<button type="button">Follow the rabbit</button>
Edit HTML
Try this → Create js/script.js and select the button with querySelector.
Basic accessibility
Basic accessibility
Use real buttons for actions, labels for inputs and meaningful headings. Keyboard focus must remain visible.