Snippets

css

Center an element horizontally and vertically

The simplest modern way to center a block using flexbox.

html

Responsive image

How to give the browser several image variants for different screen sizes.

css

Sticky header

A header that stays visible while the page scrolls: copy-ready HTML and CSS with position: sticky and top: 0, plus why sticky needs a scrolling parent.

css

Responsive table

An overflow-x:auto wrapper for horizontal table scrolling on narrow screens.

css

Simple modal (no JS)

A modal dialog that opens and closes with pure CSS via the :target pseudo-class.

html

Accordion (details/summary)

A native accordion built on details/summary, accessible out of the box, no JS.

css

Responsive CSS Grid cards

A card grid that adapts its column count to screen width, with no media queries.

css

Visually hidden accessible text

A CSS class for text that screen readers announce but sighted users don't see.

html

Lazy-loaded image

The loading="lazy" attribute for deferring images that are off-screen.

meta

Basic Open Graph / meta template

A ready-made set of meta tags for a correct link preview on social media.

html

Accessible navigation menu

A semantic navigation menu with aria-label and correct use of nav/ul/a.

html

Breadcrumbs

Semantic breadcrumb markup with nav+ol and aria-label.

html

Skip-to-content link

A skip link hidden until focused, for quickly jumping to the main content.

css

Hero section

A compact hero block with a heading, subtitle, and call-to-action button using flexbox.

css

Card component

A basic card component with a heading, text, and a hover lift effect.

css

Tabs (no JS)

Switching tabs with pure CSS using hidden radio inputs and labels.

css

Tooltip (CSS-only)

A hover tooltip built with CSS ::after and a transition.

css

Responsive iframe / video embed

Using aspect-ratio to make an embedded iframe responsive while keeping a 16:9 ratio.

meta

JSON-LD Organization snippet

A ready-made JSON-LD Organization template for a company's structured data.

meta

Favicon / head template

A minimal set of favicon tags for correct display across browsers and mobile.