All HTML guides

Find a guide to sharing, fixing or building an HTML page.

Guides 841-900 of 2735. Page 15 of 46.

select tag html
The HTML select tag: options, groups and reading the value
How the HTML select tag works: option value vs text, optgroup, a placeholder that cannot be submitted, multiple select, reading values in JavaScript, and styling.
geolocation html
Get the user's location in HTML with the Geolocation API
Get the user's location with navigator.geolocation: the permission prompt, HTTPS, options, error codes 1-3, iframe permission, and haversine distance.
intersectionobserver javascript
IntersectionObserver in JavaScript, with live examples
How IntersectionObserver works in JavaScript: threshold, rootMargin and root, with live examples for scroll reveal, infinite scroll and seen tracking, plus fixes.
parallax html
Parallax scrolling in HTML: four ways to build it
Parallax scrolling in HTML: background-attachment: fixed, CSS perspective, a JavaScript layer effect and scroll-driven animations. Live examples and phone fixes.
glassmorphism css
Glassmorphism in CSS: build a frosted glass card
Make a frosted glass card with CSS: a see-through background, backdrop-filter blur, light border and shadow. Live generator, readable text, fallbacks and dark mode.
css perspective
CSS perspective: make 3D transforms actually look 3D
How CSS perspective adds real depth to rotateX, rotateY and translateZ. Parent property vs perspective(), preserve-3d, backface-visibility, a cube and a tilt card.
css animation keyframes
CSS animation keyframes, property by property
How @keyframes and the animation properties work: from, to and percentages, duration, delay, fill-mode, steps() and the shorthand order, with live examples to copy.
css order flex
Reorder flex and grid items with the CSS order property
How the CSS order property reorders flex and grid items: default 0, negative values, ties, moving a sidebar on phones, and why Tab still follows the HTML.
gap css
CSS gap: space between items without margins
How the CSS gap property spaces items in flexbox, grid and multi-column layouts, why it beats margins, and what to check when gap does nothing.
video tag html
The HTML video tag: attributes, captions and background video
How the HTML video tag works: controls, poster, source formats, muted autoplay, a CSS-style background video, WebVTT captions and a custom player to copy.
section tag html
The section tag in HTML: section vs article vs div
When to use the HTML section tag, and when article or a div fits better. How a section becomes a region landmark, heading levels, and a blog page example.
text decoration css
Text decoration in CSS: every line, style and offset
Style underlines and strikethroughs with text-decoration: style, colour, thickness and offset. A live builder, the child-underline trap and link styles to copy.
html dir rtl
Right-to-left pages with dir="rtl", <bdi> and logical CSS
Set dir="rtl" for Arabic and Hebrew, isolate user names with <bdi>, and write CSS that flips on its own. Live examples, code to copy, and fixes for jumbled text.
print css
Print CSS: style a page for paper with @media print
Style a web page for printing with @media print: hide menus, print link addresses, keep background colours, set @page margins and add a Print button. Live examples.
text to speech javascript
Text to speech in JavaScript with speechSynthesis
Make a web page read text aloud with the Web Speech API: speak, pause and stop, pick a voice, fix an empty getVoices() list, and highlight words as they are read.
svg tag html
The SVG tag in HTML, from viewBox to paths
How the svg tag in HTML works: the viewBox coordinate system, rect, circle, line, polygon and path, fill and stroke, groups, text, CSS styling and accessibility.
drag and drop list html
Build a drag and drop sortable list in HTML
Build a drag-to-reorder list in plain HTML and JavaScript: the Drag and Drop API, a pointer version that works with touch, keyboard moves and reading the new order.
css min height
CSS min-height: a floor that lets content grow
How CSS min-height differs from height, why 100vh is too tall on phones and what dvh fixes, why flex children need min-height: 0 to scroll, and when % is ignored.
css columns
CSS columns: flow text and cards into columns
Flow text into newspaper columns with CSS columns. Live examples for column-count, column-width, column-span and break-inside, plus a masonry-style card wall.
id vs class css
id vs class in CSS and HTML: which one to use
An id names one element, a class labels many. See why #id beats three classes, what a duplicate id breaks, and how to name and select each in CSS and JavaScript.
requestanimationframe javascript
requestAnimationFrame in JavaScript: build a smooth animation loop
How requestAnimationFrame works: the timestamp, speed that does not depend on frame rate, cancelAnimationFrame, and one update per frame. Live examples and fixes.
date format javascript
Format a date in JavaScript
Format dates in JavaScript for people and for machines: toLocaleDateString options, Intl.DateTimeFormat, "3 days ago", yyyy-mm-dd, and the off-by-one-day bug.
lightbox html
Build an HTML lightbox with the dialog element
Build an image lightbox in plain HTML and JavaScript with the dialog element: captions, next and previous, arrow keys, swipe, and focus back on the thumbnail.
grid template areas
CSS grid-template-areas: draw the layout as text
Draw a CSS layout as text with grid-template-areas. Try a live area editor, switch layouts with container queries, and fix areas that silently do nothing.
card layout html
Build a card layout with HTML and CSS
Build a card layout in HTML and CSS: the markup, buttons pinned to the bottom, a responsive grid, a whole-card link that keeps inner buttons working. Live examples.
css mix blend mode
CSS mix-blend-mode and background-blend-mode, with live examples
Try every CSS blend mode on a live example, make text that inverts over any background, tint images with background-blend-mode, and fix blending that does nothing.
css mask image
CSS mask-image: fade edges, shape images and recolour icons
Use CSS mask-image with a gradient to fade text and scroller edges, or with an SVG to recolour icons. Live examples, code to copy, and fixes.
css counter
CSS counters: automatic numbers for anything on the page
CSS counters beyond lists: counter-reset, counter-increment, counter-set, 01 and Roman styles, 1.1 headings, "Figure 3" captions and a no-JavaScript checkbox tally.
css accent color
CSS accent-color: one line to recolour native form controls
One CSS property tints native checkboxes, radio buttons, range sliders and progress bars. Live examples, which controls it reaches, dark mode and what it can't do.
play sound javascript
Play a sound with JavaScript
Play a sound effect from JavaScript with new Audio().play(), handle the autoplay error, overlap sounds, and make beeps with the Web Audio API. Live examples.
css writing mode
CSS writing-mode: vertical text, upright letters and sideways headers
Set vertical text with writing-mode: vertical-rl, keep letters upright with text-orientation, fit numbers with text-combine-upright, and build sideways headers.
css shape outside
Wrap text around any shape with CSS shape-outside
Wrap text around a circle, a polygon or an image's transparent parts with CSS shape-outside. Live examples, shape-margin, clip-path and fixes when it fails.
mutationobserver javascript
Watch DOM changes with MutationObserver
Detect DOM changes in JavaScript with MutationObserver: options, records, batching and the infinite-loop trap. Live examples to try, code to copy, and fixes.
resizeobserver javascript
ResizeObserver: react when an element changes size
Detect when an element changes size, not just the window. ResizeObserver entries, the box option, sharp canvas charts, and the fix for the loop error.
typewriter effect css
Typewriter effect with CSS (and when you need JavaScript)
Typewriter text in pure CSS with steps() and ch, why normal fonts break it, and a JavaScript version that types, deletes and loops. Live examples and code.
css container queries
CSS container queries: components that fit the space they get
Make a card change layout based on the box it sits in, not the window. container-type, @container, named containers and cqi units, with live examples and fixes.
camera html
Use the camera in an HTML page
Open the camera from a web page: a file input with capture, or getUserMedia into a video. Take a photo on a canvas, pick the back camera, and fix the errors.
css flex direction
CSS flex-direction: row, column and the two reverses
flex-direction sets which way flex items flow, and justify-content and align-items turn with it. Live examples of row, column, the reverse values and a phone layout.
css grid row start
Place CSS grid items by line number: row start, span and -1
Place grid items with grid-row-start, grid-column and span. A live lab shows line numbers, -1, implicit tracks, overlap with z-index and grid-auto-flow: dense.
css anchor positioning
CSS anchor positioning: place one element next to another
Attach a tooltip or menu to a button with anchor-name, position-anchor and position-area, flip it when space runs out, and add a small JavaScript fallback.
css outline
CSS outline and focus rings that people can actually see
How CSS outline works: width, style, colour and outline-offset, rounded outlines, :focus vs :focus-visible, a focus ring that survives forced colours, and fixes.
async await javascript
Async and await in JavaScript, with live examples
How async and await work in JavaScript: what a Promise is, try/catch, Promise.all vs allSettled vs race, await in loops, timeouts and cancelling. Live demos to try.
css logical properties
CSS logical properties: the full map from left and width to inline and block
CSS logical properties name sides by text flow, so one stylesheet works in ltr, rtl and vertical text. The full physical-to-logical map, live demos and fixes.
css image rendering
CSS image-rendering: sharp pixel art instead of a blur
Scale pixel art and QR codes without blur using image-rendering: pixelated. Compare auto, pixelated and crisp-edges live and turn off canvas smoothing.
footer html css
Build a footer with HTML and CSS
Build a footer with HTML and CSS: when footer is the page landmark, what goes inside, columns that stack on phones, a footer that stays at the bottom, dark contrast.
touch events javascript
Touch events in JavaScript: taps, swipes and pinches
How touchstart, touchmove and touchend work, why pointer events are the simpler choice, and how to detect a swipe and a pinch. Live examples to try on a phone.
random number javascript
Random numbers in JavaScript, from Math.random() to a fair shuffle
Get a random integer between min and max in JavaScript, shuffle an array fairly, and know when Math.random is not enough. Live examples and code to copy.
particles html
Make a particle effect in HTML with canvas and JavaScript
Build a particle effect in plain HTML and JavaScript: a fountain, a network background that reacts to the pointer, and a confetti burst. Live code to try and copy.
font feature settings css
Font feature settings in CSS: numbers, ligatures and small caps
Turn on tabular numbers, ligatures, small caps, slashed zeros and fractions in CSS. Live demos that test your installed fonts, the code, and why nothing changes.
css background clip
CSS background-clip: boxes, origin and gradient text
How background-clip and background-origin decide where a background is painted and where it starts. Live demos for gradient text, textured text and gradient borders.
tel link html
Tel links in HTML: call, text and email buttons
Build click-to-call, text and email links in HTML: the tel: format, sms: and mailto: with encoded text, button styling, accessible link text and sandbox limits.
css will change
CSS will-change: prepare an animation without breaking the page
will-change tells the browser a property is about to animate. Add it just before, remove it after, and watch for the z-index and position: fixed side effects.
css color mix
CSS color-mix(): lighten, darken and build a palette in plain CSS
Mix two colours in CSS with color-mix(), lighten or darken with relative colour syntax, and build a whole palette plus hover states from one brand variable.
css has selector
The CSS :has() selector: style an element by what is inside it
Style a parent by what it contains with CSS :has(). Cards, form states, a scroll lock, quantity queries and a theme switch, plus specificity and fallback rules.
h2 tag
The h2 tag and h3 to h6: heading levels that make an outline
How to use the h2 tag and h3 to h6 under it: picking a level from its place in the page, subtitles with hgroup, and a live outline viewer that checks your headings.
base tag
The HTML base tag: href, target and what it breaks
What the HTML base tag does to every relative link, image and #anchor on a page. Live examples for href and target, the trailing slash rule, and fixes.
kbd tag
The HTML kbd tag: show keyboard keys, program output and variables
How the HTML kbd tag marks keys and typed input, when to use samp and var instead, how to nest them for shortcuts, and CSS for key caps you can press.
css background size
CSS background-size: how big the background image is drawn
How background-size works: cover, contain, auto, one and two values, percentages and background-origin, plus repeat round and why fixed backgrounds fail on phones.
responsive images
Responsive images with srcset: which file the browser picks
How srcset w and x descriptors, sizes and the picture element decide which image file loads. Live demos show the chosen file through currentSrc.
del tag
The del tag, ins and s: crossed-out text that means something
When to use del, ins or s for crossed-out text, what datetime and cite do, how to mark a sale price, and a live diff that writes del and ins for you.