Subscription includes:

-

Full access to all our courses

New courses added monthly

Weekly coding challenges

Exclusive chat access

Cancel whenever

Prefer one-time fees instead? Click here to buy this course for $0

Start learning now!

Learn Flexbox for free

Learn Flexbox for free

This tutorial teaches you CSS Flexbox through 12 interactive screencasts. You'll learn all the key concept in addition to building a responsive navbar and a neat image grid.

What's inside

This course contains 13 interactive screencasts.

Learn Flexbox for free

13 scrims

49 min

You'll learn

Flexbox Basics

Main axis

Cross axis

Justify content

Positioning items

The flex property

Align items

Wrapping

Flex grow, shrink, basis

Order

Creating Navbar

Creating image grid

Prerequisites

Before taking this course, you should have a basic understanding of HTML and CSS. Here’s our suggested resource to get you up to speed.

The course creator

Meet your teacher

Per Harald Borgen

Front-end developer and co-founder of Scrimba. Per loves helping other people learn new skills so that they can improve their lives. He makes his tutorials as simple as humanly possible, and focus on getting the students to the point where they can start building projects on their own.

Why this

course rocks

Once you've learned CSS Flexbox, you'll wonder how you ever managed to build websites without it. It gives you all the tools you needed in order to properly arrange content inside flexible containers. Given that all websites need to be flexbile and responsive these days, Flexbox is a must-have skill for web developers.

Course content

This course is focused on getting you up to speed as quickly as possible. Even if you only watch the first lectures, you'll be able to take advantage of your new skills in your next project. I'll give you several exercises throughout the course, so that you'll be able to get your hands dirty as well.

We'll use a navbar as an example layout, as that's a very typical use case for Flexbox. In the bonus screencasts we'll tie everything together and build two real-world examples: an awesome image grid and a fully responsive navbar.

You can follow the course creator Per Harald Borgen on Twitter here.

Join the Scrimba community chat

Learning alone can be lonely. Click here to join our Discord server and connect with other Scrimba learners!

F to the A to the Q

When should I use Flexbox?

Flexbox really shines when you need to solve these: scaling, vertically and horizontally aligning, and re-ordering elements within a container, changing direction in a column or a row.

Is Flexbox responsive?

Yes, if you wish to more about responsiveness, Flexbox is one aspect you should learn about.

Is Flexbox better than bootstrap?

For a couple of reasons, flexbox is much better than bootstrap: Bootstrap uses floats to make the grid system, which many would say is not meant for the web, where flex-box does the opposite by staying flexible to the items' size and contents; same difference as using pixels vs em/rem, or like controlling your divs only using margins and padding and never setting a pre-defined size. Bootstrap, because it uses floats, needs clearfix after each row, or you will get misaligned divs of different height. Flex-box doesn't do that and instead checks for the tallest div in the container and sticks to its height.

Should I use CSS Grid or Flexbox?

Flexbox is made for one-dimensional layout and Grid is made for two-dimensional layouts. This means that if you’re laying out items in one direction (for example three buttons inside a header), then you should use Flexbox. It’ll give you more flexibility than CSS Grid. It’ll also be easier to maintain and require less code. However, if you’re going to create an entire layout in two dimensions — with both rows and columns — then you should use CSS Grid