HTML Examples Library
69 examples · all runnable online, source viewable, free to download
Application-level HTML examples — more than syntax demos: complete, ready-to-use pieces with polished UI and combined fundamentals. Preview live, copy the source, or download every example. Pair it with the HTML tutorial and reference manual for systematic learning.
Category:
User Login FormBuild a complete user login form with HTML and CSS: email/password inputs, a remember-me checkbox, and a submit button. Run it online or download the ZIP source for free.
Native Form ValidationAn HTML native form validation example: required/pattern/minlength checks plus :user-invalid state styling. The browser blocks invalid submissions with zero JS.
Registration FormAn HTML multi-field registration page example: text inputs, a grouped optgroup select, a fieldset radio group, a terms checkbox, and a submit button. Run online, download free.
Survey Form UIAn HTML survey form example: fieldset groups, radios, checkboxes, a rating scale, and a textarea. Pure semantic HTML, run online, download free.
Dropdown NavigationAn HTML dropdown navigation example: a nav element with nested ul lists, a CSS :hover / :focus-within submenu, zero JS. Run online, download free.
Podcast Audio PageAn HTML podcast page example: native audio controls plus a past-episodes list layout. Listen online, download the ZIP source for free.
Responsive GalleryAn HTML responsive gallery example: a figure/figcaption semantic gallery on an auto-fill grid with descriptive alt text. Run online, download free.
Video Player PageAn HTML5 video player page example: multiple video sources for webm/mp4 compatibility, native controls, and a track subtitle rail. Run online, download free.
HTML-Only AccordionA pure-HTML accordion example: details/summary collapsible panels with zero JavaScript. Run online, download the ZIP for free.
Native Dialog ModalA real modal built on the native dialog element: showModal() traps focus inside, Esc closes it and ::backdrop paints the overlay for you. The confirm buttons use form method="dialog" to return a value — no libraries involved.
Progress DashboardAn HTML progress dashboard example: progress and meter semantics plus a stat-card layout. Run online, download free.
Search with DatalistAn HTML datalist search example: native input suggestions on an input element, zero-JS city search. Run online, download the ZIP source for free.
Accessible FAQ PageAn HTML FAQ help page example: details Q&A panels and semantic grouped sections forming a ready-to-use help center template.
Resume CV PageAn HTML resume page example: header, main, section, article, time, and address semantic tags forming a complete resume template.
Course TimetableAn HTML course timetable example: caption, colgroup, thead/tbody/tfoot, and rowspan working together to recreate a real weekly schedule.
Pricing TableAn HTML pricing table example: thead/tbody/tfoot grouping, scope attributes, and a highlighted recommended column. Run online, download free.
Staff ScheduleAn HTML staff schedule example: rowspan for team blocks and colspan for shared days off, showing how complex table data is structured. Run online, download free.
Anchor Fragment NavigationSticky left-TOC + right content, native href="#id" anchors, IntersectionObserver highlights current section
Contact Block with Native Link Protocolsmailto + tel + sms + download + external link — five native protocols, browser opens matching app
External Link Safety — rel noopener noreferrertarget=_blank must get rel="noopener noreferrer" to prevent window.opener hijack + hide referrer. download attribute forces save-as.
Semantic Breadcrumb Navigationnav aria-label + ol (ordered position) + li[aria-current=page] + BreadcrumbList JSON-LD for search-engine rich snippets
Skip Link — Keyboard-First NavigationTop of body, visually-hidden but focus-visible, href=#main + main tabindex=-1 — the a11y win most commonly missed
Seven Landmarks — Full Article PageAll seven semantic landmarks on one page, with Schema.org BlogPosting structured data
Blog Post Template with figure, time, Schema.orgarticle whole-page + figure/figcaption hero + time datetime publish date + itemscope BlogPosting
Definition List — HTML Glossarydl/dt/dd three-step definition list + dfn term + nested dl for multi-meaning terms — alternative to tables
Quotes and Citations — blockquote, q, cite, abbrFour quote elements with distinct jobs: blockquote=long, q=short inline, cite=source, abbr=abbreviation
Auto-Synchronized Heading Outline TreeScript walks h1-h6 to build indented tree, IntersectionObserver highlights current heading, deliberately shows a second h1 as a bad example
Fieldset + Legend + Label Grouped FormMulti-fieldset grouping with legend naming + label-for binding, radio wrapped in label for click-anywhere selection
Grouped Dropdown with optgroupNative optgroup renders bold group headings in-browser — zero JS, zero custom UI, long dropdowns are readable
Output Element — Live CalculationThree range sliders + <output> live volume display, output with for attribute listing dependent inputs, announced as live region by screen readers
Meter — Native Gaugemeter renders native gauge auto-colored via low/high/optimum — green/yellow/red tiers; CSS cannot change its internal striping
Progress — Task Trackerprogress with max+value = determinate, no value = indeterminate animated strip. meter shows a value in a known range, progress shows task completion
Details — Single Foldable FAQMultiple independent <details>/<summary> blocks for FAQ pages — each folds and unfolds on its own.
Menu — Semantic NavigationThe semantic <menu> element for interactive navigation and action lists.
Noscript — JS-Dependent Site FallbackGraceful fallback content when JavaScript is disabled — not just 'please enable JS'.
Dialog — Native open AttributeNative <dialog> modal with static open attribute and ::backdrop styling — pure HTML.
Colgroup — Column Layout ControlUse <colgroup> with <col> to control column width, alignment, and styling from one place.
Rowspan — Complex Grid MergeRowspan merges cells downward across multiple rows — great for schedules, grade books, and rosters.
Accessible Table — Headers & ScopeUse scope, id, and headers attributes so screen readers know which headers belong to each cell.
Picture — Responsive Art DirectionProvide different source images at different breakpoints — not just different resolutions, but different crops or subjects.
Audio — Subtitle TrackAdd captions, descriptions, and chapters to <audio> and <video> with <track> — no JavaScript needed.
Video — Poster & PreloadConfigure poster thumbnail, preload behavior, and controlsList for a well-behaved <video> element.
Aside — Sidebar CalloutsTangential content boxes: definitions, tips, and warnings that can be removed without breaking the main narrative.
Figure — Semantic Image GroupGroup self-contained content (images, code blocks, quotes) with <figure> and its caption <figcaption>.
hgroup — Title with SubheadingGroup a primary heading with subtitle/byline so outline tools treat them as one heading unit.
Textarea — Multi-Line InputCaptures multi-line input with rows/minlength/maxlength attributes. Use CSS min-height for baseline height.
Template + Slot — Declarative TemplatingLearn how <template> holds inert HTML fragments and <slot> marks dynamic insertion points — the declarative core of Web Components.
Data Attributes + CSS — State Without JSCustom data-* attributes store metadata on any element. CSS attribute selectors react to them — zero JavaScript for pure presentation toggles.
Time — Semantic Date/TimeMark up dates and times with the <time> element and its datetime attribute — browsers, search engines, and calendars all read it.
Address — Contact SemanticsThe <address> element marks up contact info for an article's author or an organization — not a generic mailing address box.
HR — Thematic BreakUse <hr> to mark thematic shifts between paragraphs — not just a decorative horizontal rule.
Small — Side Comments & Legal TextThe <small> element represents side comments, fine print, and legal disclaimers — content that's secondary but still readable.
Text Emphasis — strong, em, b, i, s, uSix inline elements for text styling — not all are equal. Learn when to pick semantic strong/em over presentational b/i.
ins / del — Track ChangesMark edits with <ins> and <del>, optionally cite the source and datetime. Screen readers and search engines understand these elements natively.
abbr / dfn / var — Definitions & VariablesThree specialized inline elements: <abbr> for expandable abbreviations, <dfn> for defining instances, and <var> for mathematical variables.
kbd / samp / code / pre — Computer OutputFour elements for computer-related text: keyboard input, program output, code fragments, and preformatted blocks — each with distinct semantics.
bdi / bdo — Bidirectional TextHandle mixed RTL/LTR text correctly. <bdi> isolates unknown-direction runs; <bdo dir="rtl"> forces direction when the algorithm gets it wrong.
ruby / rt / rp — Pronunciation AnnotationsAttach pronunciation hints above text with <ruby>, <rt>, and <rp> — furigana, pinyin, hangul, and IPA annotations.
iframe — Sandboxed EmbedsEmbed pages safely with <iframe sandbox="..."> — grant only the permissions you need, everything else is blocked by default.
embed / object / param — Legacy PluginsThe legacy plugin-embedding trio — mostly superseded by <video>, <audio>, and sandboxed iframes, but still useful for SVG with fallback.
Heading Hierarchy — h1 through h6Six heading levels build your document outline. One h1 per page, nest consecutively (h1→h2→h3). Headings are for structure, not just typography.
Paragraphs & Line Breaks — p vs br<p> wraps one or more sentences into a semantic paragraph block. <br> forces a line break inside a paragraph without starting a new one.
span — Inline Style ContainerThe generic inline container for styling text where no semantic element (em, strong, abbr) fits. Reach for span last.
sup / sub — Superscript & Subscript<sup> marks superscript (above baseline): math powers, footnotes, ordinals. <sub> marks subscript (below): chemical formulas, log bases, variable indices.
mark — Highlighting Text<mark> indicates text relevant to the user's current activity — search hits, filtered content, or annotated quotes. Not just a yellow background.
wbr — Soft Word Break Opportunity<wbr> suggests a break point to the browser without inserting a hyphen. Perfect for long URLs, camelCase identifiers, and compound words.
data — Machine-Readable Values<data value="..."> associates a machine-readable value with human-readable text — ratings, prices, stock codes. For dates and times use <time> instead.
Complete Table — thead / tbody / tfootThe full table model with all three sections. <tfoot> renders at the bottom regardless of source position — great for totals, averages, and printed tables with repeated headers/footers.
Image Map — map & area HotspotsThe legacy image-map duo — <map> + <area> turns any image into clickable regions. Mostly superseded by clickable SVG, but still useful for non-SVG graphics (photos, legacy diagrams) where slicing would be wasteful.
No examples at this difficulty in this category