scroll‑state Container Query Demo - Online Test stuck/snapped
Experiment with scroll‑state container queries to style elements when they are stuck, snapped, or overflowed. Experimental.
UD5 Toolkit
Track metrics and gain insights with real-time dashboards.
Enterprise-grade protection for your data pipeline.
One-click deployments to production environments.
@container at-rule, you can apply styles conditionally when a container meets certain size conditions (like minimum width). This enables truly component-based responsive design—the same component adapts whether it's in a narrow sidebar or a wide main content area.
container-type property. The most common value is container-type: inline-size; which allows querying the container's inline (width) dimension. You can also assign a container-name for targeted queries. Example: .card-wrapper { container-type: inline-size; container-name: cards; } Then use @container cards (min-width: 500px) { ... }.
@media) respond to the viewport (browser window) size—they're page-level. Container Queries (@container) respond to a specific parent element's size—they're component-level. This means a card component can adapt its layout based on its own container's width, regardless of the viewport size. Container queries enable truly reusable, self-contained responsive components.
@supports or progressive enhancement approaches. Check caniuse.com for the latest data.
min-width, max-width, min-height, max-height, and logical properties like min-inline-size. Combine conditions with and, or, and not. You can also use container query length units: cqw (1% of container width), cqh (1% of container height), cqi, cqb, cqmin, and cqmax. These work like viewport units but are relative to the container.
container-name values to different elements and target them specifically in your @container rules. For example: @container sidebar (max-width: 300px) { ... } will only match a container named "sidebar". If you omit the name—@container (min-width: 600px) { ... }—it matches the nearest ancestor container of any name.
container-type set (this playground's container already has container-type: inline-size). 2) Check your selector targets elements inside the container. 3) Ensure your @container syntax is correct—use parentheses around conditions. 4) If using a named container, verify the name matches. Click "Apply CSS" after editing to ensure changes take effect. The status indicator shows green when the style is live.
Experiment with scroll‑state container queries to style elements when they are stuck, snapped, or overflowed. Experimental.
Build the same layout with both Grid and Flexbox side by side. See the code differences and visual results.
Design a layout where nested grids share track sizes with their parent via subgrid. Copy the complete CSS.
Create a pure CSS scroll progress indicator using animation‑timeline: scroll(). No JavaScript. Copy the complete code.
Paste your CSS and see warnings for properties that have limited browser support. Links to CanIUse. Modernize safely.
Enter a GraphQL endpoint, write a query, and see the response. Add headers and variables. Simple testing client.
Limit browser gestures on an element: pan‑x, pinch‑zoom, manipulation. Draw on a canvas to test. Mobile dev helper.
Connect a gamepad and see all button presses and axis movements visually. Check that every input is detected correctly.
Create complex linear gradients with any number of color stops, exact angles, and length units. Live preview and CSS code.
Style underlines, overlines, and strike-throughs with colors, wavy styles, and thickness. Modern CSS text‑decoration.
Design a button or card that glows on hover. Adjust shadow color, spread, and transition. Copy the CSS. Rich UI.
Create a realistic letterpress (debossed) text effect using CSS text‑shadow and background. Adjust depth and light direction. Copy code.
Generate a subtle noise/grain texture as a CSS background pattern. Adjust opacity and size. For that film look.
Create a customizable checkerboard or grid background using pure CSS gradients. Adjust cell size and colors. Copy the code.
Upload two images and apply CSS blend modes (multiply, screen, overlay, etc.). See the result and copy the filter CSS. Pure frontend.
Add print styles like removing backgrounds, adding page breaks, setting margins. See print preview instantly.
Create a pure CSS countdown timer with a flipping number effect. Adjust duration and style. No JavaScript needed for display.
Create a glowing or rotating border animation around an element. Copy the CSS keyframes. Pure CSS magic.
Create a custom HTML/CSS progress bar with percentage, colors, and animation. Copy the code. Modern UI element.
Press any key and see it light up on a standard QWERTY layout. Check functionality or demonstrate shortcuts.
Design a realistic neon sign text with multiple layers of glow. Copy the CSS and HTML. Perfect for headers.
A replica of the famous Flexbox Froggy game: solve alignment puzzles by writing CSS. Progress saved locally. Fun frontend learning.
Fetch a website's CSS and extract :root custom properties (‑‑color) to reveal its design token palette. For learning and inspiration.
Recreate the target CSS linear gradient by adjusting stops and colors. A unique game for front‑end developers to master gradients.
Browse and search all Font Awesome 6 icons with preview, class name, and unicode. Copy the HTML snippet. Perfect for web developers.
Create text with a gradient fill using CSS background-clip. Configure colors and direction. Copy the code. Works in modern browsers.
Press keys on your physical keyboard and see them highlighted on a virtual keyboard. Detects multi-key rollover. Quick hardware check.
A complete, searchable list of all 140+ named HTML/CSS colors with their hex codes and color previews. Click to copy code. Essential web reference.
Visually experiment with Flexbox container and item properties. See the layout update in real time and copy the CSS. Learn by doing, fully interactive.
Minify JavaScript and CSS code to reduce file size for production. Remove whitespace and comments instantly. Run locally, your code stays private.