hyphens CSS Tester - Online Auto, Manual, None
Set hyphens: auto with lang attribute and see automatic hyphenation. Perfect for justified text. Browser built‑in.
UD5 Toolkit
Understand CSS Grid auto-fill vs auto-fit with real-time visual comparison
auto-fill and auto-fit tell the browser to create as many grid tracks as possible within the available space. The key difference: auto-fill preserves empty tracks (leaving visible gaps where items could go), while auto-fit collapses empty tracks and lets existing items stretch to fill the available space. Think of auto-fill as "reserving seats" and auto-fit as "only setting up chairs for people who showed up."
minmax(), the behavior difference is barely noticeable. The minmax(min, 1fr) pattern is essential because the 1fr maximum allows auto-fit items to grow and fill extra space when empty tracks collapse. If you use a fixed value like minmax(150px, 150px), both auto-fill and auto-fit behave identically — columns stay at 150px and the extra space just sits unused. The 1fr is what makes the visual difference dramatic.
repeat(auto-fit, 200px) is valid CSS — it creates as many 200px columns as fit, and collapses empty ones. However, without 1fr, there's no stretching behavior. The items stay at exactly 200px. The minmax() function unlocks responsive flexibility: columns can be at least the minimum but expand when space allows. This is what makes auto-fit layouts feel truly fluid and responsive.
minmax()'s minimum value, both auto-fill and auto-fit behave the same: they create a single column, and the item width is clamped to the container width (potentially overflowing if content is larger). This is why choosing a sensible minimum (like 200px–280px) is important for mobile-responsive designs. Test your layout at narrow widths to ensure items don't become unusably small.
minmax(140px, 1fr): available width ≈ 620px − (n−1)×12px (where n is the number of columns). The browser then determines how many 140px columns fit. Gaps consume space, so larger gaps reduce the maximum number of columns. This is why adjusting gap can sometimes cause items to wrap or unwrap.
auto-fill and auto-fit are part of the CSS Grid Level 1 specification and have excellent browser support — all modern browsers including Chrome 57+, Firefox 52+, Safari 10.1+, and Edge 16+ support them fully. They're safe for production use. Internet Explorer 11 had partial grid support but did not support auto-fill/auto-fit, so if IE11 support is required, you'll need a fallback like @supports queries.
auto-fill/auto-fit with fixed track sizes in grid-template-columns. For example: grid-template-columns: 200px repeat(auto-fill, minmax(150px, 1fr)) 80px; — this creates a 200px sidebar, flexible center columns, and an 80px end column. The auto-fill/auto-fit only applies to the repeated section, while fixed tracks remain constant. This is powerful for complex responsive layouts.
minmax() maximum must be a flexible unit like 1fr — if it's a fixed pixel value, items won't stretch. (2) Ensure there are fewer items than the maximum possible columns — if all tracks are filled, auto-fill and auto-fit look identical. (3) Check that grid items don't have explicit max-width or justify-self constraints that override the grid's sizing. Use your browser's DevTools grid inspector to see exactly how tracks are being sized.
Set hyphens: auto with lang attribute and see automatic hyphenation. Perfect for justified text. Browser built‑in.
A textarea that expands in height as you type. See the implementation and copy the code. No library needed.
Create a customizable checkerboard or grid background using pure CSS gradients. Adjust cell size and colors. Copy the code.
New CSS text‑spacing property for fine control over punctuation spacing. See the effect live. For advanced typography.
Design a square foot garden by dragging vegetables into a grid. See companion planting warnings and spacing tips. Print plan.
Experiment with scroll‑state container queries to style elements when they are stuck, snapped, or overflowed. Experimental.
Learn how to let content extend a few pixels beyond a clip boundary with overflow‑clip‑margin. Interactive playground.
Build a horizontal scroll‑snap container with configurable snap‑type and alignment. Perfect for image galleries.
Compare all CSS easing presets side by side on a bouncing ball. See which curve fits your UI animation.
Process audio faster than real‑time with OfflineAudioContext. Apply filters and export the result. Dev tool.
Toggle image‑rendering: auto, pixelated, crisp‑edges on a scaled image. Essential for pixel art display.
Calculate large Fibonacci numbers in a Web Worker. See the UI remain responsive. Copy the pattern for your app.
Compare different grid track sizing methods: fr, auto, minmax(), and fixed values. See how they respond to content.
See how grid-auto-flow: row vs column changes item placement. Add and remove items to understand the algorithm. Visual.
Request notification permission and create a push subscription. See the subscription object. Learn how web push works.
Demonstrate how to add custom headers and POST‑like functionality to EventSource using a polyfill. Code and example.
Build the same layout with both Grid and Flexbox side by side. See the code differences and visual results.
Scroll a container and see how sticky elements behave. Adjust top, bottom, and scroll margins. Copy the code.
Set the inset property and see its logical shorthand equivalents. Copy the modern CSS for absolutely positioned elements.
See the difference between clone and slice on inline boxes that break across lines. Useful for multi‑line headings.
See the difference between :focus and :focus‑visible on interactive elements. Learn which to use for better UX.
Toggle between light and dark mode for a demo page. See how to use the media query. Copy the pattern.
See the roving tabindex pattern in action. Use arrow keys to navigate a list. Copy the accessible JavaScript pattern.
Add rows and columns, merge cells, and set gaps visually. Get the grid‑template CSS and HTML. Fast layout prototyping.
See how align‑items: baseline works in grid to align different font sizes on the same baseline. Visual guide.
Test the experimental Translation API to translate text between languages directly in the browser, without cloud calls. Check support and copy the JavaScript starter.
Toggle scrollbar‑gutter: stable to reserve space for the scrollbar and avoid content jumps. Visual demo with two columns.
Test overscroll‑behavior: contain to prevent background scroll or pull‑to‑refresh. See the effect in a live demo.
Acquire and release locks across tabs. Prevent race conditions in IndexedDB or localStorage. Visual queue and lock state.
Register a periodic background sync to fetch fresh data even when the tab is closed. Understand the API and limits.