S
Seoffix.com
Sign In Get Pro Membership

HTML & CSS

CSS Flexbox

Beginner HTML/CSS 25 XP

CSS Flexbox

display: flex lays children in a row, and justify-content spreads them.

Example

.row { display: flex; gap: 8px; }

Your task

Make .row a flex container that centres its items horizontally.

Hints

  1. display: flex first
  2. justify-content: center

Check your understanding

Answer every question to pass.
1. Which property centres flex items along the main axis?

Live playground

Press Run to see the result.

AI Code Explainer & Translator

Runs without any outside service.
 
Mark Complete & Earn XP
Earn 25 XP after you pass the quiz. Finish every lesson in the track to earn its certificate.
Sign in to earn XP

HTML & CSS

Lessons in this track
Questions about this lesson? Ask the Coding & Web Dev squad. Discuss in Community