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.
Enter number of eyelet pairs and lacing style to find the correct shoelace length in inches/cm. Never buy too short.
Enter two city names or coordinates and get the straight‑line distance in miles/km. Local calculation.
Estimate the sinker weight needed to hold bottom in current based on line diameter, depth, and current speed.
Enter piece count and piece size to estimate finished dimensions. Check if it fits your table.
Enter rolls remaining and household size to estimate weeks of supply. A humorous yet practical aid.
Enter amount of kernels and see estimated popped volume. Plan movie night snacks perfectly.
Calculate ideal stereo speaker placement (toe-in, distance from wall) for best soundstage. Visual diagram. For audiophiles. Local tool.
Find the optimal TV size for your room or the best viewing distance based on screen size and resolution (1080p, 4K, 8K). Simple THX/SMPTE reference.
Estimate BAC based on gender, weight, drinks consumed, and time. Uses Widmark formula. Educational tool, never encourage drunk driving. Local only.
Enter any date and get its ISO week number, plus the start and end dates of that week. Quick reference.
Paste your CSS and see warnings for properties that have limited browser support. Links to CanIUse. Modernize safely.
Enter a hex color and get its relative luminance per WCAG definition. Understand why this matters for contrast.
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.
Create a customizable checkerboard or grid background using pure CSS gradients. Adjust cell size and colors. Copy the code.
Add N business days to a date, skipping weekends and optionally entering custom holidays. Regional presets.
Create a custom HTML/CSS progress bar with percentage, colors, and animation. Copy the code. Modern UI element.
Calculate the exact number of days, weeks, months, and workdays between two dates. Visual calendar highlights. Perfect for projects.
Choose your cup size and sweetness level, and get exact proportions for tea, milk, syrup, and tapioca pearls. Perfect homemade boba every time.
Combine multiple identical batteries in series and parallel and see the resulting voltage and total capacity. Electronics helper.
Determine the minimum sample size needed for a survey or A/B test with a given confidence level and margin of error.
Easily compute posterior probabilities given prior, likelihood, and marginal likelihood. Visual diagram. All local.
Find out how large you can print based on image resolution in pixels. Understand DPI and megapixels.
Learn about f‑stops and their effect on light and depth. Calculate equivalent exposure adjustments. Educational.
Measure your waist‑to‑hip ratio and learn about associated health risks. WHR interpretation. Educational only.
Find what day of the week any past or future date falls on. Uses Zeller’s congruence. Fun historical reference tool.
Find the centroid (center of mass) of any convex polygon by entering vertex coordinates. Useful for physics and design.