CSS Subgrid Layout Builder - Online Align Nested Grids
Design a layout where nested grids share track sizes with their parent via subgrid. Copy the complete CSS.
UD5 Toolkit
white-space Property Demo
Compare how all 6 white-space values affect text wrapping, spacing, and overflow — all in real time.
white-space: normal
white-space: nowrap
white-space: pre
white-space: pre-wrap
white-space: pre-line
white-space: break-spaces
white-space property in CSS controls how whitespace characters (spaces, tabs, and newlines) are handled inside an element. It determines whether whitespace is collapsed (multiple spaces merged into one), whether lines wrap automatically, and whether newline characters are honored. It's essential for controlling text layout, especially when displaying code blocks, poetry, or preventing unwanted line breaks.
normal — Collapses whitespace, wraps text, ignores newlines (default).nowrap — Collapses whitespace, never wraps, ignores newlines.pre — Preserves all whitespace and newlines, never wraps.pre-wrap — Preserves all whitespace and newlines, wraps when needed.pre-line — Collapses spaces but preserves newlines, wraps when needed.break-spaces — Like pre-wrap, but every space character can be a wrapping point.
normal collapses multiple spaces into a single space and ignores newline characters — text flows as a continuous paragraph. pre-wrap preserves all spaces and newlines exactly as written, while still allowing automatic wrapping at the container edge. Use pre-wrap when you need to preserve formatting (like code or poetry) but still want text to wrap on small screens.
white-space: nowrap when you want to prevent text from wrapping to the next line. Common use cases include: navigation menus (keep all items on one line), table headers, button labels, breadcrumb trails, and any UI element where breaking would look awkward. Be cautious — long text will overflow its container, so pair it with overflow: hidden or text-overflow: ellipsis for clean truncation.
pre-line is a hybrid: it preserves newline characters (like pre) but collapses multiple spaces (like normal), and still allows automatic wrapping. It's ideal for displaying user-submitted content where you want to respect paragraph breaks (newlines) but don't care about preserving exact spacing — such as comment sections, message displays, or formatted text from a <textarea>.
break-spaces is similar to pre-wrap but with one key difference: every individual space character can serve as a line-wrapping opportunity. In pre-wrap, trailing spaces at the end of a line may "hang" (not affect layout). With break-spaces, spaces always take up space and the browser can break at any of them. This is useful for preserving exact whitespace layout while still allowing wrapping in tight containers.
white-space is set to nowrap or pre, text will not break, so it can overflow its container. This is where overflow: hidden, overflow: auto, and text-overflow: ellipsis come into play. For a clean truncated effect, combine: white-space: nowrap; overflow: hidden; text-overflow: ellipsis;. This trio is the classic way to show "..." for overflowing single-line text.
pre-wrap is generally the best choice for displaying code blocks. It preserves indentation and newlines (critical for code readability) while allowing long lines to wrap on small screens. Pure pre can force horizontal scrolling, which is frustrating on mobile. Many code-highlighting libraries use white-space: pre-wrap as their default for responsive code display.
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.
Query the permission state of camera, microphone, geolocation, and more. See the response and learn the API.
Limit browser gestures on an element: pan‑x, pinch‑zoom, manipulation. Draw on a canvas to test. Mobile dev helper.
Acquire and release locks across tabs. Prevent race conditions in IndexedDB or localStorage. Visual queue and lock state.
Test the Fullscreen API: request fullscreen on a colored div, detect changes, and copy the JavaScript boilerplate.
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.
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.
Find safe mixing ratios for the classic elephant toothpaste demonstration. Volume adjustments for different container sizes.
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.
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.
Easily create asymmetric border radius values and preview the result. Copy the generated CSS instantly. All interactively and browser-based.
Beautify and format your CSS stylesheets instantly. Organize, minify, or prettify CSS code for better readability. Processed securely on client-side.