This tutorial could not be loaded.
Loading tutorial...
Interactive tutorial
Learn to arrange elements with CSS Flexbox, control alignment and spacing, wrap items onto new lines, and adjust how items grow and shrink. By the end, you will build and check a responsive card layout in your own browser using a single HTML file.
Step 1 of 8
4 min
Create Your First Flex Container
Turn a normal card section into a spaced Flexbox row and identify the direct children that participate in the layout.
Step 2 of 8
3 min
Understand the Two Axes
Determine the main and cross axes for row and column Flexbox layouts before choosing alignment properties.
Step 3 of 8
4 min
Distribute Space Along the Main Axis
Use justify-content to position a card group or distribute remaining free space along the main axis, while keeping a fixed gap distinct from distributed space.
Step 4 of 8
4 min
Align Items Across the Main Axis
Control flex-item placement on the cross axis with align-items, including stretch and two-axis centering.
Step 5 of 8
3 min
Let Cards Wrap onto New Lines
Enable a fixed-width card row to form additional flex lines as the available width decreases.
Step 6 of 8
4 min
Set Starting Sizes and Share Extra Space
Turn a 12rem card basis into flexible card sizing by using flex-grow to share positive free space.
Step 7 of 8
5 min
Control Shrinking and Read the Flex Shorthand
Learn how flex-shrink, the complete three-value flex shorthand, wrapping, and content constraints affect narrow card layouts.
Step 8 of 8
5 min
Build and Check a Responsive Card Layout
Complete and verify a responsive Flexbox card list locally, then diagnose and explain its wide and narrow behavior.
Video Courses
recommended
Ideal for beginners
Ideal for beginners
recommended
Ideal for beginners
Ideal for beginners
Thousands of online courses in video, ebooks and audiobooks.
To test your knowledge during online courses
Generated directly from your cell phone's photo gallery and sent to your email
Download our app via QR Code or the links below:.
+ 10 million
students
Free and Valid
Certificate
60 thousand free
exercises
4.8/5 rating in
app stores
Free courses in
video and ebooks