Menu
Coddy logo textTech

gap

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

The gap property controls the space between flex items.

Example,

.container {
  display: flex;
  gap: 16px;
}

The properties row-gap and column-gap controls the space in each axis separately 

challenge icon

Challenge

Easy

add to the given flexbox gap spacing, you can add more flex container properties if you like.

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>5</div>
            <div>6</div>
            <div>7</div>
            <div>8</div>
            <div>9</div>
            <div>10</div>
            <div>11</div>
            <div>12</div>
        </div>
    </body>
</html>

All lessons in CSS Flexbox - The Complete Course