CSS Media Query Generator - Online Quick Syntax Builder
Build a CSS media query by selecting feature, operator, and value. Copy the exact syntax for your stylesheet.
UD5 Toolkit
Interactive demo to master CSS text wrapping. Test word-break and overflow-wrap in real time.
word-break controls how lines break within words during normal text flow. It applies to all text unconditionally. overflow-wrap (formerly word-wrap) only kicks in when a word is too long to fit in its container, acting as an emergency overflow prevention mechanism.
Think of it this way: word-break: break-all will aggressively break words everywhere to fill lines tightly, while overflow-wrap: break-word tries to keep words intact and only breaks them if they would otherwise overflow the container.
Use overflow-wrap: break-word for most general-purpose scenarios — it preserves readability by keeping words whole unless absolutely necessary. Ideal for user-generated content, comments, and articles.
Use word-break: break-all when you need tight text fitting in narrow columns, like data tables, code snippets, or East Asian typography where breaking anywhere is acceptable. Be aware this can make English text harder to read.
overflow-wrap: anywhere is similar to break-word, but with one key difference: it affects the min-content intrinsic size calculation. With anywhere, the browser considers that it can break at any point when calculating the minimum width. With break-word, the minimum width may still be based on the longest unbreakable word. This matters in flexbox and grid layouts where min-content is used.
Browser support for anywhere is good in modern browsers (Chrome 80+, Firefox 65+, Safari 15.4+).
word-break: keep-all prevents line breaks between characters in Chinese, Japanese, and Korean (CJK) text, forcing breaks only at spaces or punctuation. For English and other Latin-based languages, it behaves similarly to normal. It's particularly useful for CJK typography where you want words to stay grouped together rather than breaking between every character.
word-break: break-word is deprecated in the CSS Text Module Level 3 specification. It was an alias for overflow-wrap: break-word. While most browsers still support it for backwards compatibility, you should use overflow-wrap: break-word instead in new code. The deprecated value may be removed in future specification levels.
URLs and continuous strings (like file paths, code tokens, or very long words) are the most common overflow culprits. Without overflow-wrap: break-word or word-break: break-all, such strings will overflow their container. overflow-wrap: break-word is usually the best choice — it breaks the string only when needed, while keeping normal text readable. word-break: break-all works too but will also break normal words unnecessarily.
The white-space property handles whether text wraps at all. If white-space is set to nowrap or pre, text will not wrap regardless of word-break or overflow-wrap settings. For these wrapping properties to work, white-space must allow wrapping (e.g., normal, pre-wrap, or pre-line).
overflow-wrap: anywhere is supported in Chrome 80+, Edge 80+, Firefox 65+, Safari 15.4+, and Opera 67+. For older browsers, consider using overflow-wrap: break-word as a fallback:
.selector {
overflow-wrap: break-word; /* Fallback */
overflow-wrap: anywhere;
}
Yes, you can combine both properties. When both are set, word-break takes precedence for normal line-breaking decisions, while overflow-wrap handles overflow emergencies. A common safe combination is word-break: normal with overflow-wrap: break-word — this keeps normal text readable while preventing long strings from overflowing.
Build a CSS media query by selecting feature, operator, and value. Copy the exact syntax for your stylesheet.
Combine aspect‑ratio with min‑/max‑width/height and see how the box responds. Understand sizing constraints. Copy the pattern.
Experiment with the CSS color-mix() function. Pick two colors and mix them in different color spaces (srgb, oklch). Copy the CSS.
Experiment with CSS container queries in a live editor. Resize the container and see styles change based on its width/height. Learn modern responsive.
Write a media query and instantly see if it matches your current viewport. Width, height, orientation, and more.
Test the new style() function inside @container to query custom property values. Revolutionary component‑based responsive design.
Wrap text around an irregular shape and adjust the margin and alpha threshold. Magazines layout on the web.
Paste media queries and see a visual indicator of which rules apply at current viewport size.
Upload a photo and add text with stroke, shadow, and opacity. Position anywhere. Download as PNG. Simple caption tool.
Paste a media query and instantly check for syntax errors. See if it's correctly formed. Quick developer tool.
Classic hangman with linguistic terms (adjective, participle, etc.). Solidify your grammar vocabulary.
Visually name grid areas in a table and generate grid‑template‑areas CSS. Perfect for complex layouts. Drag‑free.
See how your title and meta description will be truncated in Google SERP by pixel width. Optimize click‑through.
Create a responsive box that maintains a specific aspect ratio using the aspect‑ratio property. Copy the simple CSS.
Preview how your page title will appear in Google SERPs. See pixel width and character count. Avoid truncation. Free local tool for SEOs.
Paste your article and see a table of the most frequent words with their density percentages. Help avoid keyword stuffing. Local.
Create a custom crossword grid with rotational symmetry. Set grid size and click to place black squares. Export as template.
Write a media query and see if it matches as you resize the iframe. Understand width, height, and resolution queries.
Browse the OKLCH color space with sliders for lightness, chroma, and hue. See the CSS oklch() code. Modern and accessible.
A horizontal photo gallery that scrolls with a smooth CSS animation using scroll‑timeline. Pure HTML/CSS. Copy the code.
Start from a base color and use `oklch(from color l c h)` to create lighter or darker variants. Copy the code.
Get three random words as a creative writing prompt. Challenge yourself to use them in a story. No repeat for a while.
See how your page title and description will look in Google SERP. Check pixel width and character count. Local tool.
Paste text and delete all empty or whitespace‑only lines. Collapse unused space. Perfect for code or prose. Local.
Build a small crossword by adding words and clues. Export as a printable grid or solve in browser. Perfect for classrooms.
Paste text and generate a word cloud as a downloadable PNG image. Customize colors and shapes. All local.
Toggle between light and dark mode for a demo page. See how to use the media query. Copy the pattern.
Paste image URLs and generate a responsive masonry or justified gallery layout with lightbox. Copy the HTML/CSS/JS.
Design a layout where nested grids share track sizes with their parent via subgrid. Copy the complete CSS.
Place a table caption on top, bottom, or inline‑start/end. See the live change. Copy the code.