CSS contain Property Demo - Online Layout & Paint Isolation
Toggle contain: strict, content, paint, layout and see how it affects rendering. Understand isolation for faster pages.
UD5 Toolkit
| Logical Property | Maps To | Example |
|---|---|---|
| block-start | top | margin-block-start → margin-top |
| inline-end | right | padding-inline-end → padding-right |
| block-end | bottom | border-block-end → border-bottom |
| inline-start | left | margin-inline-start → margin-left |
| inline-size | width | inline-size → width |
| block-size | height | block-size → height |
block-start, inline-end, block-size, and inline-size. This allows layouts to automatically adapt when switching between LTR/RTL languages or vertical writing modes (like Japanese or Mongolian), without rewriting CSS rules.
[dir="rtl"] overrides scattered throughout your stylesheets. (4) Future-proofing—the web is increasingly multilingual, and logical properties are the modern standard for internationalized layouts.
margin-block-start, padding-inline-end, etc.border-block-start-width, border-inline-start-color, etc.inline-size (replaces width), block-size (replaces height), min-inline-size, max-block-size.inset-block-start, inset-inline-end (replace top/right/bottom/left).overflow-inline, overflow-block.text-align: start / text-align: end.
writing-mode property defines the block axis and inline axis directions. In horizontal-tb (default), the block axis runs top-to-bottom and the inline axis runs left-to-right. In vertical-rl, the block axis runs right-to-left and the inline axis runs top-to-bottom. Logical properties reference these axes, so margin-block-start affects the top in horizontal-tb but the right side in vertical-rl. Use the playground above to switch modes and see the mapping update in real time!
direction only flips the inline axis (left ↔ right), swapping inline-start and inline-end. It does NOT affect the block axis. writing-mode fundamentally changes both axes—rotating the entire flow by 90°. In vertical-rl, the block axis becomes horizontal (right-to-left) and the inline axis becomes vertical (top-to-bottom). They can be combined: a vertical-rl writing mode with direction: rtl further flips the inline direction.
inset-* and overflow-* logical variants have slightly later support (Safari 15+), but core margin/padding/border/size logical properties are universally supported. You can safely use them in production, potentially with physical-property fallbacks for very old browsers.
margin-left and margin-inline-start on the same element, the one declared later in the cascade wins (just like any CSS property). A good practice is to use logical properties as your primary styling and only fall back to physical properties for very specific overrides or legacy browser support. For clean, maintainable code, consider adopting logical properties as your default approach for all spacing and sizing.
Toggle contain: strict, content, paint, layout and see how it affects rendering. Understand isolation for faster pages.
Define a set of colors for light and dark themes. Get the CSS custom properties snippet. Toggle live.
Manipulate CSS values as typed objects using attributeStyleMap. Convert between CSSUnitValue, CSSMathSum, etc. Futuristic CSS‑in‑JS.
Reset native styling on form elements with appearance: none. See before and after. Essential for custom forms.
Understand @layer by visually ordering style layers and seeing which rules win. Fix specificity battles. Modern CSS architecture.
Paste your stylesheet and get a clean list of all custom properties defined under :root. Copy the whole block. Local analysis.
Implement a dark/light theme toggle that respects prefers‑color‑scheme. Copy the complete JavaScript and CSS.
Create a frosted glass card with background blur, border glow, and shadow. Adjust intensity. Copy the CSS.
Write slides in Markdown and instantly preview a web‑based presentation. Export as HTML. Pure frontend.
Access the Paint Timing API and display First Paint, First Contentful Paint, and Largest Contentful Paint times. Quick perf check.
Mix sodium hypochlorite with water to get the correct % concentration for soft washing. Safety note.
Based on home and destination time zones, suggests a light exposure/avoidance schedule to reduce jet lag. Educational tool, local only.
Paste your CSS and see rules sorted by specificity. Find overrides and potential collisions. Understand your cascade.
Calculate total work hours and pay from time-in/out entries. Supports overtime and breaks. Generate a printable timesheet. All local.
See how extra monthly or lump‑sum payments reduce your mortgage term and total interest. Dynamic chart. All local calculation.
Estimate curing time for UV resin based on lamp wattage and layer thickness. Avoid sticky finishes.
Enter total balance and limit to see utilization percentage. See how it affects credit score bands.
Calculate flour, water, starter amounts to achieve a target loaf hydration. Adjusts for starter hydration. Instant local calculation.
Enter a date and location (or use GPS) to see exact golden hour and blue hour times for perfect natural light.
Get a random, unique superpower with a detailed description and limit. Perfect for character creation or daydreaming.
Enter your must volume and current Brix, TA, and pH to calculate additions of sugar, acid blend, or tannin. Standard winemaking formulas.
Build a renovate.json file to automate dependency updates. Choose schedule, automerge, and package rules. Local.
Estimate how long a battery will last given capacity (mAh/Wh) and load current. Also computes backup time for power banks. Quick and local.
See the current Service Worker registration, its state, and scope. Send 'skipWaiting' and update. PWA debug.
Calculate travel time by entering distance and average speed. Add rest stops duration. Get estimated arrival time. Simple travel planner.
List all resources loaded by the current page and their detailed timing breakdown. In‑browser waterfall.
Estimate arrival time with driving duration, breaks, and time zone changes. Plan your road trip precisely.
Click to get a random, unique superpower with a description. Perfect for character creation or daydreaming.
List your debts and compare the total interest paid using avalanche vs snowball methods. Pick the best strategy.
Set an alarm relative to today's sunset (e.g., 30 minutes before). Perfect for evening routines. Uses geolocation (optional).