All HTML guides
Find a guide to sharing, fixing or building an HTML page.
Guides 961-1020 of 2735. Page 17 of 46.
paragraph html
Paragraphs in HTML: the p tag and readable text
How the HTML p tag really works: why a div or list inside a paragraph splits it, when the closing tag is optional, and how to space and size readable paragraphs.
body css
Body CSS: how to style the HTML body element
How to style the body element: remove the default 8px margin, why the body background fills the window, 100% vs 100dvh, theme classes and modal scroll lock.
colors html
Colors in HTML: every way to write a colour, and how to check contrast
Every way to write colors in HTML and CSS: names, 3 to 8 digit hex, rgb(), hsl(), oklch(), transparency and currentColor, plus a live contrast ratio calculator.
css isolation
CSS isolation: isolate, the stacking context with no side effects
isolation: isolate makes an element a stacking context and changes nothing else. Stop z-index leaks, contain mix-blend-mode, and find contexts with a live inspector.
css font rendering
CSS font rendering: what each property actually changes
What text-rendering, font-kerning, -webkit-font-smoothing and font-size-adjust really change, measured in Chromium. Live tests for your own fonts, plus the code.
css tab size
CSS tab-size: control how wide a tab is
Set how wide a tab is with the CSS tab-size property. Live examples for pre and textarea, tabs vs spaces, white-space, and a code viewer with a tab width picker.
svg circle
SVG circle and ellipse: cx, cy, r, rx and ry
How the SVG circle and ellipse work: cx, cy, r, rx and ry as attributes and CSS properties, animating cx with a transition, rounded rect corners and a drag editor.
svg text
SVG text: position, centre, break and curve it
How SVG text works: x and y, text-anchor, dominant-baseline for vertical centring, tspan line breaks, textPath on a curve, and labels screen readers can read.
forced colors css
Forced colors in CSS: make your page work in high contrast mode
What forced colors mode does to your CSS, and the fixes: @media (forced-colors: active), system colours like Canvas and Highlight, forced-color-adjust, testing.
html like button
Build a like button in HTML, CSS and JavaScript
Build a heart like button from a real button with aria-pressed, an SVG heart and a count. Add a pop animation, reduced motion and an optimistic update.
keyboard shortcut javascript
Add keyboard shortcuts to a page with JavaScript
Add keyboard shortcuts with JavaScript keydown: e.key vs e.code, Mac Cmd vs Ctrl, skipping text fields, preventDefault, a Ctrl+K command palette and a help dialog.
hover effect css
Hover effects in CSS: a gallery for buttons, cards and images
Four hover effects in plain CSS: a lifting button, a growing underline, an image zoom and a sliding caption. Live examples, keyboard focus and touch screens covered.
wheel event javascript
The wheel event in JavaScript
How the JavaScript wheel event works: deltaY and deltaMode, why preventDefault is ignored, trackpad pinch as ctrlKey, sideways scroll and canvas zoom.
textcontent javascript
textContent in JavaScript: read and set plain text
What element.textContent reads and sets, how it differs from innerText with hidden text and line breaks, why it is faster, and how to put user text on a page safely.
css carousel scroll marker
CSS carousel with scroll markers: dots and arrows from CSS alone
Build a CSS-only carousel with ::scroll-marker, ::scroll-button, scroll-target-group and scroll-initial-target. Live demos, tested engines and a script fallback.
css text spacing trim
CSS text-spacing-trim and text-autospace for Japanese and Chinese text
Close the gaps around Japanese and Chinese brackets and commas with text-spacing-trim, and add space next to Latin text with text-autospace. Live demos included.
css font palette
CSS font-palette and @font-palette-values
Change the colors inside a color font with font-palette and @font-palette-values. Live examples on the Segoe UI Emoji font, measured browser results, and fixes.
css object view box
CSS object-view-box: crop and zoom an image in one line
Use CSS object-view-box with inset() to crop and zoom an image or video on the element itself, animate the zoom, and add a fallback for browsers that ignore it.
css box decoration break
CSS box-decoration-break: slice vs clone
box-decoration-break: clone gives every wrapped line its own padding, corners and shadow. Live examples, the -webkit- prefix rule, and boxes split across columns.
css overflow anchor
CSS overflow-anchor and scroll anchoring, with live examples
How scroll anchoring keeps your place when content loads above, when overflow-anchor: none is the right call, and how to keep a chat log stuck to the bottom.
css reading flow
Make Tab follow the layout with CSS reading-flow
reading-flow makes keyboard Tab follow the visual order of a grid or flex layout moved with order or grid placement. Live examples, all values, a safe fallback.
css svg shape rendering
SVG rendering hints: which ones change the pixels
What shape-rendering, vector-effect, color-interpolation, color-rendering and buffered-rendering change on screen, measured in Chromium, Firefox and WebKit.
scroll reveal javascript
Scroll reveal with JavaScript and CSS
Reveal elements on scroll with IntersectionObserver and a CSS transition. Live examples for fade, slide and zoom, stagger, once or repeat, and reduced motion.
map marker html
Map markers in HTML, without a map service
Clickable map markers on an SVG map or floor plan with plain HTML, CSS and JavaScript: percent positions, popups, grouping and keyboard access. Live examples.
3d in browser
3D in the browser with plain CSS, from a cube to a product viewer
Build 3D in the browser with plain CSS: a cube from six divs, drag to rotate, a product box viewer with preset views, and when to switch to WebGL. Live code.
urlpattern javascript
URLPattern in JavaScript: match a URL and pull out its parts
Match URLs with URLPattern in JavaScript: named groups, wildcards, optional parts, a tiny router in one file and a RegExp fallback. Live examples you can edit.
devtools chrome html
Debug your own HTML page with Chrome DevTools
Use Chrome DevTools on your own HTML page: inspect an element, edit CSS live, read console errors, spot 404s and test phone widths. Three broken pages to fix.
html performance
HTML performance: measure a single page yourself
Measure an HTML page yourself: performance.now, marks and measures, long tasks, layout thrashing and image sizes, with live examples and a panel you can copy.
toggle event html
The toggle event in HTML: react when details or a popover opens
The toggle event fires when a details element or a popover opens or closes. Live examples of toggle, beforetoggle, newState and oldState, and a one-open accordion.
css interactivity inert
CSS interactivity: inert and the inert attribute
Lock the page behind a drawer or modal so clicks, Tab and focus cannot reach it. The inert attribute, the new CSS interactivity: inert, and measured support.
css resize
CSS resize: let users resize a box
Make a div resizable with the CSS resize property and one overflow line. Live demos of every value, min and max limits, a resizable sidebar, and fixes.
webgpu
WebGPU in an HTML page: draw with the GPU
Use WebGPU in a plain HTML page: get a device, write a WGSL shader, draw a triangle, animate it with a uniform buffer and run a compute shader. Live examples.
css border shape
CSS border-shape: draw a border in any shape
CSS border-shape draws a border along a circle, polygon or shape() path, and the shadow follows. Live examples, stroke vs fill mode, browser support and a fallback.
css hide on click
Hide an element on click with HTML, CSS and a little JavaScript
Hide an element when it is clicked: the one line of JavaScript, the CSS rule it needs, display vs visibility vs opacity, a no-JS option and a fade-out.
pointer events javascript
Pointer events in JavaScript: one handler for mouse, pen and touch
Replace mouse and touch listeners with pointer events: one handler for a mouse, a pen and every finger. pointerType, capture and smoother lines, with live demos.
css speak
The CSS speak property, and what to use instead
The CSS speak property switches speech on or off per element. See which browsers parse it, test it live, and hide text from screen readers the way that works.
css empty cells
CSS empty-cells: hide the borders of empty table cells
empty-cells: hide removes the border and background of empty table cells. Live examples, what counts as empty, and why it needs border-collapse: separate.
css app region
CSS app-region: a draggable title bar for installed web apps
CSS app-region: drag turns part of an installed web app's title bar into a handle that moves the window. Live examples, no-drag for buttons, and support.
css dynamic range limit
CSS dynamic-range-limit: control how bright HDR images get
Use the CSS dynamic-range-limit property to cap how bright HDR images and video get. Live examples, the four values, browser support and a gallery pattern.
css baseline shift
CSS baseline-shift: raise or lower part of an SVG text line
How the CSS baseline-shift property raises or lowers part of SVG text: sub, super and lengths, why HTML ignores it, the dy trap, and browser support.
css overflow block
CSS overflow-block: overflow that follows the writing mode
overflow-block is overflow-y that follows writing-mode: it scrolls down in horizontal text and sideways in vertical text. Live demos, the media feature, and support.
css overflow-clip-margin
CSS overflow-clip-margin: move the edge where clipping starts
How CSS overflow-clip-margin moves the edge where overflow: clip cuts content, with live demos, the box keywords, browser support and a Safari fallback.
css hyphenate limit chars
CSS hyphenate-limit-chars: control where hyphens: auto may split
hyphenate-limit-chars sets how long a word must be before it is hyphenated, and how many letters stay on each side of the hyphen. Live demos, value rules, support.
css font language override
CSS font-language-override: pick which language's glyphs a font uses
How font-language-override makes a font use the letter forms of another language: the OpenType tag value, how it differs from lang, traps, and browser support.
css baseline source
CSS baseline-source: choose the first or last line
baseline-source picks which line of a multi-line inline-block or inline-flex box sits on the text line. Live examples, the three values, and a fallback for Safari.
css shape image threshold
CSS shape-image-threshold: choose how solid the wrap shape is
shape-image-threshold sets how opaque a pixel must be to join a shape-outside image shape. Live gradient examples, clamping, percentages and browser support.
css shape margin
Add an even gap around a shape with CSS shape-margin
shape-margin keeps wrapped text an even distance from a shape-outside curve. Live examples, why the gap stops at the float's edge, and how it differs from margin.
css overflow inline
CSS overflow-inline: what happens when a line is too long
overflow-inline decides what happens when a line is longer than its box: clip it or scroll along it. Live demos, vertical text, the fallback and browser support.
email templates in outlook
Email templates in Outlook, built in HTML
Build an Outlook email template as one HTML file: a live table-based example, what classic Outlook's Word engine skips, where Outlook stores templates, and fixes.
svelte
Run Svelte in one HTML file
Svelte is a compiler, so there is no one-line script tag. Run a Svelte 5 component in one HTML file with the in-browser compiler, plus fixes and sharing.
jquery
jQuery in a single HTML file
Add jQuery to a single HTML file with one script tag, then click, toggle and add items. A live example to edit, the common mistakes, and how to share it as a link.
mermaid
Use Mermaid in a single HTML file
Use Mermaid in a plain HTML file: one module script turns diagram text into SVG. Live examples, the smallest working page, and fixes for the usual errors.
angular
Angular in a single HTML file
Run Angular from one HTML file with no install: live examples, the four parts every page needs, the errors that leave it stuck on Loading, and how to share it.
typescript
Use TypeScript in a single HTML file
Browsers run JavaScript, not TypeScript. Compile it inside a single HTML file with the official compiler from a CDN. Live examples, common errors and sharing.
sveltekit 3
SvelteKit 3 and single HTML files
SvelteKit 3 is still a prerelease, and SvelteKit needs a build either way. What does run in one HTML file: Svelte compiled in the browser, live examples included.
streamlit
Streamlit and HTML: from a Python app to one file you can share
Streamlit apps need a running Python server. Two ways to get one HTML file instead, live examples of a Streamlit-style app in plain JavaScript, and fixes.
next js html
Next.js and HTML: from a Next.js page to a plain HTML file
How Next.js turns your pages into HTML, how to export static HTML files, and how to rebuild a small Next.js page as one HTML file you can open, edit and share.
web components
Web components in a single HTML file
Build a web component in a single HTML file with customElements.define and Shadow DOM. Live examples, a Lit version from a CDN, and fixes for the usual errors.
leaflet map
A Leaflet map in a single HTML file
Make a Leaflet map in a single HTML file: one CSS link, one script tag and a div with a height. Live examples, common mistakes, and sharing it as a link.
htmx
htmx in a single HTML file
htmx adds requests and page updates to HTML through attributes. A working single-file example with no server, the common mistakes, and how to share it as a link.