Snippets
Center an element horizontally and vertically
The simplest modern way to center a block using flexbox.
htmlResponsive image
How to give the browser several image variants for different screen sizes.
cssSticky 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.
cssResponsive table
An overflow-x:auto wrapper for horizontal table scrolling on narrow screens.
cssSimple modal (no JS)
A modal dialog that opens and closes with pure CSS via the :target pseudo-class.
htmlAccordion (details/summary)
A native accordion built on details/summary, accessible out of the box, no JS.
cssResponsive CSS Grid cards
A card grid that adapts its column count to screen width, with no media queries.
cssVisually hidden accessible text
A CSS class for text that screen readers announce but sighted users don't see.
htmlLazy-loaded image
The loading="lazy" attribute for deferring images that are off-screen.
metaBasic Open Graph / meta template
A ready-made set of meta tags for a correct link preview on social media.
htmlAccessible navigation menu
A semantic navigation menu with aria-label and correct use of nav/ul/a.
htmlBreadcrumbs
Semantic breadcrumb markup with nav+ol and aria-label.
htmlSkip-to-content link
A skip link hidden until focused, for quickly jumping to the main content.
cssHero section
A compact hero block with a heading, subtitle, and call-to-action button using flexbox.
cssCard component
A basic card component with a heading, text, and a hover lift effect.
cssTabs (no JS)
Switching tabs with pure CSS using hidden radio inputs and labels.
cssTooltip (CSS-only)
A hover tooltip built with CSS ::after and a transition.
cssResponsive iframe / video embed
Using aspect-ratio to make an embedded iframe responsive while keeping a 16:9 ratio.
metaJSON-LD Organization snippet
A ready-made JSON-LD Organization template for a company's structured data.
metaFavicon / head template
A minimal set of favicon tags for correct display across browsers and mobile.