Main Content
This main content area expands to fill available space while the sidebar maintains its fixed width.
Master Modern Flexible Layout System
Experiment with flexbox properties and see their effects in real-time:
Click on a flex item to select and modify it
Learn practical layouts you can create with flexbox:
Both horizontally and vertically!
.center-container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
Flexible card content that adapts to available space.
Cards grow and shrink uniformly.
Perfect for responsive designs.
.cards-container {
display: flex;
gap: 1rem;
flex-wrap: wrap;
}
.card {
flex: 1 1 300px;
}
Compare flexbox with traditional layout techniques:
Test your flexbox skills by recreating these layouts:
display: flex - Creates flex containerflex-direction - Main axis directionjustify-content - Main axis alignmentalign-items - Cross axis alignmentflex-wrap - Wrapping behaviorgap - Space between itemsflex-grow - Growth factorflex-shrink - Shrink factorflex-basis - Initial sizeflex - Shorthand propertyalign-self - Individual alignmentorder - Visual orderflex: 1 - Equal flexible itemsflex: 0 0 auto - Fixed size itemjustify-content: center - Center itemsalign-items: center - Vertical centerflex-direction: column - Vertical layout