πLayout & Flexbox
Learn how to create multi-column layouts and control element positioning using Flexbox in Webstudio.
Understanding layout is fundamental to building websites in Webstudio. This guide covers the display modes, Flexbox properties, and best practices for creating responsive layouts.
Display Modes
The Display property in the Layout section controls how an element and its children are positioned. The main display modes are:
Block
Default for boxes. Elements stack vertically, taking full width
Flex
Enables flexible layouts with horizontal/vertical axis control
Grid
Two-dimensional layout system (rows and columns)
Inline
Elements flow inline like text
Inline Block
Inline flow but respects width/height
None
Hides the element completely
Flexbox Fundamentals
Flexbox is the primary tool for creating layouts in Webstudio. When you change display to Flex, you gain control over how child elements are arranged.
Enabling Flexbox
Select the parent container (the element that holds your items)
Go to the Style Panel β Layout section
Change Display from
BlocktoFlex
Flex Direction
Control whether children are arranged horizontally or vertically:
Row (default): Items arranged horizontally left to right
Row Reverse: Items arranged horizontally right to left
Column: Items stacked vertically top to bottom
Column Reverse: Items stacked vertically bottom to top
Alignment
Flexbox provides two axes for alignment:
Justify Content
Aligns items along the main axis (horizontal for row, vertical for column)
Align Items
Aligns items along the cross axis
Common alignment values:
Start: Items at the beginning
Center: Items centered
End: Items at the end
Space Between: Equal space between items
Space Around: Equal space around items
Space Evenly: Equal space including edges
Gap
Add consistent spacing between flex items using the Gap property. This is cleaner than adding margins to individual items.
Flex Wrap
By default, flex items try to fit on one line. Enable Flex Wrap to allow items to wrap to the next line when they don't fit:
In the Layout section, find the Wrap toggle
Click to enable wrapping
Items will now flow to the next line when space runs out
Flex wrap is essential for responsive card layouts. Combined with min-width on cards, they'll automatically stack on smaller screens.
Common Layout Patterns
Multi-Column Card Layout
Structure:
Steps:
Create a Box and change tag to
sectionAdd a Box inside as a container (for max-width)
Add another Box for the cards wrapper
Set the cards wrapper to
display: flexAdd Gap between cards
Enable Flex Wrap for responsiveness
Add individual Card boxes inside
Centering Content
To center a single element both horizontally and vertically:
Set parent to
display: flexSet Justify Content to
CenterSet Align Items to
Center
Navigation Layout
For a typical header with logo and nav items:
Header container:
display: flexJustify Content:
Space Between(logo left, nav right)Align Items:
Center(vertically centered)
Sizing Properties
Width & Height
Width
Fixed width of element
Min Width
Minimum width (won't shrink below)
Max Width
Maximum width (won't grow beyond)
Height
Fixed height of element
Min Height
Minimum height
Max Height
Maximum height
Flex Child Properties
When an element is inside a flex container, additional properties become available:
Flex Grow
How much the item should grow relative to siblings
Flex Shrink
How much the item should shrink relative to siblings
Flex Basis
Initial size before growing/shrinking
Align Self
Override the parent's align-items for this specific item
Container Best Practices
Section + Container Pattern
A common pattern for page sections:
Outer Box (Section tag)
Full width background colors
Vertical padding for spacing
Inner Box (Container)
max-width: 1200px(or your preferred max)margin: 0 auto(centers horizontally)Horizontal padding for mobile edges
This allows backgrounds to extend full width while content stays contained.
Naming Convention
Use clear names for organization:
Plural for parent containers:
Cards,Features,TestimonialsSingular for individual items:
Card,Feature,Testimonial
Learning CSS Properties
All properties in Webstudio's Style Panel use standard CSS names. To learn more about any property:
Hover over the property name for a tooltip explanation
Search online for "CSS [property-name]" (e.g., "CSS flex-wrap")
Resources like MDN Web Docs provide detailed documentation
Creating layouts is primarily done through styling, not components. You won't find a "columns" component β instead, you create columns by applying flex properties to boxes.
Visual Indicators
The Style Panel uses colors to indicate property states:
Blue
Property is set on the current element/token
Orange
Property is inherited from a parent or cascading from a larger breakpoint
No color
Property is using browser default
Related Resources
Responsive Design β Working with breakpoints
Design Tokens β Creating reusable styles
Custom Classes & Attributes β Advanced styling options
Last updated
Was this helpful?
