Menu
Coddy logo textTech

Flexbox

Lesson 3 of 15 in Coddy's CSS Flexbox - The Complete Course course.

Let's talk about the flex container.

To create flex container set the display property to flex,

.container {
  display: flex;
}

This can work with the following HTML part,

<div class="container">
  <div>1</div>
  <div>2</div>
  <div>3</div>
  <div>4</div>
</div>
challenge icon

Challenge

Easy

Create a flex container.

You are given the HTML code for it, your task is to add the missing CSS code.

Note: Don't change the given HTML code or the CSS which color the elements.

Try it yourself

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="styles.css">
</head>
    <body>
        <div class="container">
            <div>1</div>
            <div>2</div>
            <div>3</div>
            <div>4</div>
        </div>
    </body>
</html>

All lessons in CSS Flexbox - The Complete Course