CSS Container Queries Playground - Online Test @container
Experiment with CSS container queries in a live editor. Resize the container and see styles change based on its width/height. Learn modern responsive.
UD5 Toolkit
@container style() is a CSS container query feature that allows you to conditionally apply styles based on the computed style values of a container element — most commonly CSS custom properties (variables). Unlike @container size() which responds to dimensions, style queries check things like --theme: dark or --variant: primary, enabling truly context-aware components.
@container (min-width: 400px)) respond to the container's dimensions. Style queries (@container style(--theme: dark)) respond to CSS property values on the container. This means a single component can adapt to its context without knowing about viewport sizes — perfect for design systems where the same card component needs to look different inside a dark sidebar vs a light main content area.
@container style(). Firefox and Safari are actively working on implementation. You can use @supports (container-type: inline-size) as a progressive enhancement fallback. For non-supporting browsers, provide base styles that work without the query.
--theme: dark|light on any ancestor.--variant: primary|secondary|danger.--density: compact|comfortable|spacious.container-name is optional. Without it, @container style(--x: 1) matches the nearest ancestor with a container-type. Using a named container like @container my-container style(--x: 1) lets you target a specific ancestor, which is useful when multiple containers are nested.
and / or logic: @container style(--theme: dark) and style(--variant: primary) { ... }@container style(--density: compact) or style(--density: comfortable) { ... }not: @container not style(--theme: dark) { ... }
Experiment with CSS container queries in a live editor. Resize the container and see styles change based on its width/height. Learn modern responsive.
Build a CSS media query by selecting feature, operator, and value. Copy the exact syntax for your stylesheet.
Paste a media query and instantly check for syntax errors. See if it's correctly formed. Quick developer tool.
Paste media queries and see a visual indicator of which rules apply at current viewport size.
Experiment with the CSS color-mix() function. Pick two colors and mix them in different color spaces (srgb, oklch). Copy the CSS.
Combine aspect‑ratio with min‑/max‑width/height and see how the box responds. Understand sizing constraints. Copy the pattern.
Write a media query and see if it matches as you resize the iframe. Understand width, height, and resolution queries.
Write a media query and instantly see if it matches your current viewport. Width, height, orientation, and more.
Create a responsive box that maintains a specific aspect ratio using the aspect‑ratio property. Copy the simple CSS.
Visually name grid areas in a table and generate grid‑template‑areas CSS. Perfect for complex layouts. Drag‑free.
Compare break‑all, keep‑all, and overflow‑wrap: anywhere/break‑word. Paste long words and see how they wrap.
Toggle between light and dark mode for a demo page. See how to use the media query. Copy the pattern.
Place a table caption on top, bottom, or inline‑start/end. See the live change. Copy the code.
Paste image URLs and generate a responsive masonry or justified gallery layout with lightbox. Copy the HTML/CSS/JS.
Browse the OKLCH color space with sliders for lightness, chroma, and hue. See the CSS oklch() code. Modern and accessible.
Wrap text around an irregular shape and adjust the margin and alpha threshold. Magazines layout on the web.
A horizontal photo gallery that scrolls with a smooth CSS animation using scroll‑timeline. Pure HTML/CSS. Copy the code.
Toggle image‑rendering: auto, pixelated, crisp‑edges on a scaled image. Essential for pixel art display.
Upload a small pixel art image and get a CSS grid layout that recreates it using divs. Novelty developer tool.
Upload an image at multiple widths and generate a complete <picture> or <img srcset> snippet. Modern web performance.
Preview how your page title will appear in Google SERPs. See pixel width and character count. Avoid truncation. Free local tool for SEOs.
Design a layout where nested grids share track sizes with their parent via subgrid. Copy the complete CSS.
Start from a base color and use `oklch(from color l c h)` to create lighter or darker variants. Copy the code.
See how your page title and description will look in Google SERP. Check pixel width and character count. Local tool.
Upload ugly SQL and get a beautifully indented, syntax‑highlighted version. Supports multiple dialects. All local.
Add services like Node, Postgres, Redis, and Nginx. Configure ports, volumes, and env vars. Download the docker‑compose.yml.
Interactively apply CSS filter functions (blur, brightness, contrast, etc.) to an image and copy the resulting filter property. No coding required.
Upload any picture and instantly get a 5‑color palette. Useful for UI design themes. Canvas‑based extraction.
Format and beautify SQL queries for improved readability. Supports various SQL dialects. Quick syntax highlighting and local processing ensure a secure experience.
Drag a virtual ruler across your screen to measure pixel distances. Horizontal and vertical guides. Useful for UI designers checking alignment.