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.
Find the ideal height to hang art based on wall and furniture dimensions. Follow gallery standard 57‑inch center rule.
See how scroll‑padding and scroll‑margin affect the position of elements when using anchor links or scroll‑snap. Visual.
Change all alignment and justification values and see the flex items move. Indispensable for learning Flexbox.
Design a custom focus indicator with outline, offset, and box‑shadow. Preview on interactive elements. Copy the CSS.
Paste your CSS and see warnings for properties that have limited browser support. Links to CanIUse. Modernize safely.
Toggle contain: strict, content, paint, layout and see how it affects rendering. Understand isolation for faster pages.
Design a fully styled scrollbar with colors, width, radius, and hover effects. Supports both ::-webkit‑scrollbar and Firefox scrollbar‑width.
Design a fully styled scrollbar with colors, width, and border radius. Get the CSS for Chrome and Firefox.
Browse the built‑in styles that browsers apply to HTML elements. Understand why your page looks different. Static reference.
Enter an IP and CIDR prefix to visually see network address, broadcast, usable range, and subnet mask conversions.
Visually configure scroll‑snap containers and items. Adjust alignment, stop behavior, and padding. Copy the clean CSS instantly.
Define password rules and see a live checklist that updates as you type. Design better password UX for your app.
Create a 'SALE' or 'NEW' corner ribbon in pure CSS. Adjust colors, position, and text. Great for e‑commerce.
Set the inset property and see its logical shorthand equivalents. Copy the modern CSS for absolutely positioned elements.
Understand @layer by visually ordering style layers and seeing which rules win. Fix specificity battles. Modern CSS architecture.
Design a pure CSS tooltip with custom text, position (top/bottom/left/right), and arrow. Copy the clean code.
Use isolation: isolate to contain mix‑blend‑mode and filters. See the visual difference with and without. Quick demo.
Build a custom CSS reset by toggling which elements to normalize. Copy the resulting stylesheet. Lean and clean.
Design neumorphic elements by adjusting box‑shadow parameters. Real‑time preview and CSS output. For modern soft UI interfaces.
Create CSS mask‑image effects with custom shapes, gradients, and SVGs. Visually see the mask applied to an image. Copy the CSS.
Generate a range of tints and shades from a single hex color. Ideal for data visualization, UI design systems, and Tailwind custom palette creation. Local tool.
Upload an image and generate the CSS to use it as a custom mouse cursor. Test it live. Fun for personal websites.
Paste a screenshot or image, crop it, and add arrows, rectangles, and text. Essential for bug reports and tutorials.
Fill in a form to generate a clean, ATS‑friendly one‑page resume. Customize sections, colors, and export as print‑ready PDF. Personal data stays in your browser.
Design layered box shadows interactively and get the CSS code in real time. Adjust offset, blur, spread, and color. Essential tool for UI designers.
Set tab‑size to any number and see how tabs are displayed in a pre element. Essential for code snippets.
Use the browser's native eyedropper tool to pick any color from the screen. Shows zoomed preview. Quick and easy.
Touch the screen and see the exact coordinates, radius, and force of each touch point. Indispensable for mobile web devs.