Flexbox Playground - Online CSS Flex Layout Generator
Visually experiment with Flexbox container and item properties. See the layout update in real time and copy the CSS. Learn by doing, fully interactive.
UD5 Toolkit
flex-grow or flex-shrink. It essentially sets the starting size of an item along the main axis. The value can be a length (e.g., 200px), a percentage relative to the flex container (e.g., 50%), or the keyword auto (which uses the item's width or content size). If omitted in the flex shorthand, it defaults to 0 (though flex: auto sets it to auto).
flex-basis is not auto, it overrides width. When flex-basis: auto, the item uses its width (or content size). Key difference: flex-basis only affects the main axis size in flex layout, while width always affects horizontal size regardless of layout mode. Use flex-basis for flex-specific sizing to avoid unexpected behavior.
flex shorthand: flex: [grow] [shrink] [basis].flex-grow distributes remaining space proportionally. Each item gets: basis + (grow / total-grow) × remaining.flex-shrink reduces items proportionally. Shrink is weighted by shrink × basis, so larger items shrink more (unless shrink is 0).auto: Use when you want items to respect their intrinsic content size or explicit width. Great for navigation menus or when items have natural sizes.0: Use when you want pure proportional distribution (all space divided by grow ratios). Perfect for equal-width columns where content size shouldn't influence layout.250px): Use for fixed-size components like sidebars, avatars, or when you need a minimum starting size. Combine with flex-grow: 0 to keep it fixed, or allow growing with flex-grow: 1.
flex-basis values are relative to the content-box width of the flex container. For example, if the container is 800px wide (content-box), flex-basis: 50% equals 400px. Note that container padding reduces the content-box, affecting the percentage calculation. In this tool, the visualization container uses box-sizing: border-box, and percentages are computed against the full container width for simplicity.
flex-shrink: 0 is set, the item should not shrink below its flex-basis. However, items can still appear smaller due to: (1) min-width: auto on flex items (the default) may allow shrinking to fit content — set an explicit min-width: 0 to override; (2) overflow constraints; or (3) the total of all non-shrinking items exceeding the container width, causing overflow rather than shrinking. Always check min-width if you see unexpected shrinkage.
flex: 1 is shorthand for flex: 1 1 0% — meaning flex-grow: 1, flex-shrink: 1, flex-basis: 0%. The zero basis means all items start from 0 and grow proportionally, resulting in perfectly equal columns regardless of content. In contrast, flex: auto (or flex: 1 1 auto) bases the initial size on content, so items with more content get more space. This distinction is crucial for creating truly equal-width layouts.
Visually experiment with Flexbox container and item properties. See the layout update in real time and copy the CSS. Learn by doing, fully interactive.
Adjust margin, border, padding, and content sizes interactively and see the rendered box model. Get the exact CSS. Teach or learn layout.
Change all alignment and justification values and see the flex items move. Indispensable for learning Flexbox.
Use isolation: isolate to contain mix‑blend‑mode and filters. See the visual difference with and without. Quick demo.
Visually design a custom :focus‑visible outline style. Copy the CSS. Better than the default.
Project your retirement savings growth with monthly contributions, employer match, and CAGR. Interactive chart. Financial data stays on your device.
Select character sets (Latin, Cyrillic, Greek) and generate the exact unicode‑range descriptor for your fonts. Improve performance.
Paste your CSS and see warnings for properties that have limited browser support. Links to CanIUse. Modernize safely.
Load images or use colors and apply all 15 CSS blend modes. Visual tester for creative effects.
Visually configure scroll‑snap containers and items. Adjust alignment, stop behavior, and padding. Copy the clean CSS instantly.
See the difference between :focus and :focus‑visible on interactive elements. Learn which to use for better UX.
Create a 'SALE' or 'NEW' corner ribbon in pure CSS. Adjust colors, position, and text. Great for e‑commerce.
Set width, height, depth, and colors to generate an isometric box using CSS transforms. Copy to your project.
Find the ideal height to hang art based on wall and furniture dimensions. Follow gallery standard 57‑inch center rule.
Generate a random HTML/CSS card with different box model properties. Inspect and guess the size. For learners.
Create outlined text with the text‑stroke property. Adjust width and color. Preview and copy the CSS.
Define password rules and see a live checklist that updates as you type. Design better password UX for your app.
Learn how to let content extend a few pixels beyond a clip boundary with overflow‑clip‑margin. Interactive playground.
Use anchor positioning to perfectly center a popover relative to its anchor. No JavaScript. See the modern approach.
Enter spring constant and displacement to find force and stored energy. Visual compression.
Enter an IP and CIDR prefix to visually see network address, broadcast, usable range, and subnet mask conversions.
Design neumorphic elements by adjusting box‑shadow parameters. Real‑time preview and CSS output. For modern soft UI interfaces.
Design layered box shadows interactively and get the CSS code in real time. Adjust offset, blur, spread, and color. Essential tool for UI designers.
Convert 3-digit capacitor codes (like 104, 222) to capacitance value in pF, nF, µF. Also converts back. Useful for reading tiny ceramic capacitors.
Create inner shadows for a pressed or sunken effect. Visually adjust and copy the CSS. Learn inset.
Paste HTML/CSS snippets or enter properties to test how z‑index and stacking contexts interact. Real‑time example.
Enter an amount and see a virtual stack of $100 bills with height comparison to everyday objects.
See the difference between clone and slice on inline boxes that break across lines. Useful for multi‑line headings.
Interactively add and adjust multiple box shadows on a sample element. Drag sliders for offset, blur, spread, and color. Copy the clean CSS code instantly.
Design a tooltip that appears on hover without JavaScript. Choose positioning, arrow, and animation. Copy the clean HTML/CSS.