Headings, paragraphs and lists
Organize a short document with semantic headings and two kinds of lists.
View exampleFree HTML, CSS & JavaScript examples
Start with a complete HTML page, try a working example, or find a quick reference. Read the code, see the result, and make it your own.
Simple code. No libraries. No account needed.
Complete working example
Start with a real document, a heading, a paragraph and a working section link.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>My code example</title>
<style>
:root{font-family:system-ui,sans-serif;color:#18223b}*{box-sizing:border-box}body{margin:0;min-height:100vh;padding:24px;background:#edf1ff;display:grid;place-items:center}main{min-width:0;width:min(100%,600px);background:white;border-radius:20px;padding:clamp(20px,5vw,32px)}h1{font-size:clamp(24px,5vw,32px);line-height:1.2;margin:0 0 16px}h2{font-size:20px;margin:24px 0 12px}p,li{line-height:1.65}a{color:#2545a8;text-underline-offset:3px}button,input,select,textarea{font:inherit}button{min-height:44px;border:1px solid #9eaed0;border-radius:10px;padding:10px 14px;background:#eff3ff;color:#18223b;cursor:pointer}a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible{outline:3px solid #3658bf;outline-offset:3px}pre{max-width:100%;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;background:#eef2fa;padding:16px;border-radius:10px}code{font-family:ui-monospace,monospace}
</style>
</head>
<body>
<main>
<h1>Hello, web.</h1>
<p>This is a complete page you can change.</p>
<a href="#next-step">Find your next step</a>
<section id="next-step">
<h2>Make it yours</h2>
<p>Change this text, save the file and refresh your browser.</p>
</section>
</main>
<script>
</script>
</body>
</html>Copy HTML includes the doctype, English language, UTF-8 charset, viewport, title and all CSS around the body shown here. The main landmark contains a heading and a named section; the link moves within this same document. Change the language and title for your own page.
Save the copied text as example.html, not a .txt file. Open it in a browser, and refresh after saving edits. The editor HTML tab contains the body; the complete document source below includes the head and document wrapper.
Choose a useful task
Start with the part your page needs.
A complete document with a heading, text and a section link.
Read, copy and tryStructure a readable page with headings and lists.
Read, copy and tryConnect destinations and show a responsive image.
Read, copy and tryPresent data with a caption and clear headers.
Read, copy and tryLabels, inputs and native browser validation.
Read, copy and tryA responsive card with inline CSS and no dependencies.
Read, copy and tryPractical building blocks
Original code, inline CSS and JavaScript, with no missing assets.
Organize a short document with semantic headings and two kinds of lists.
View exampleTry a working page anchor and learn how to label a link that opens a new tab.
View exampleCopy a complete image example with an embedded illustration, dimensions and alternative text.
View exampleRead a small table with a caption, scoped headers and a keyboard-accessible overflow region.
View exampleUse explicit labels, named controls and native validation in a form that stays local.
View exampleCopy three complete color cards using hex, RGB and HSL syntax.
View exampleA master checkbox follows a small group, including its indeterminate state.
View exampleFind an answer quickly
Browse HTML elements, look up attributes, or display symbols and escaped code.
Find a color and compare contrast. Try a keyboard-accessible scrollbox or a live digital clock.
Edit HTML, CSS and JavaScript, run an isolated preview and copy the complete document. Lesson previews explain known missing-resource limits.
New to HTML?
Try a link, an image, or a small data table.
Save the HTML, open it in a browser and test at a narrow width and with a keyboard. Read each example’s limits before adapting it.