Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS CSS Flexbox Layout Flexbox Properties Wrapping Items and Distributing Space

Deon Cole
Deon Cole
658 Points

First, make .row a flex container.

style.css
/* Complete the challenge by writing CSS below */
.row { flex: container;
}
index.html
<!DOCTYPE html>
<html>
<head>
  <title>Flexbox Layout</title>
  <link href='https://fonts.googleapis.com/css?family=Varela+Round' rel='stylesheet' type='text/css'>
  <link rel="stylesheet" href="page.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <div class="row">
    <div class="item">Item 1</div>
    <div class="item">Item 2</div>
    <div class="item">Item 3</div>
    <div class="item">Item 4</div>
    <div class="item">Item 5</div>
    <div class="item">Item 6</div>
  </div>
</body>
</html>

2 Answers

Sergio Andrés Herrera Velásquez
PLUS
Sergio Andrés Herrera Velásquez
Courses Plus Student 12,777 Points

basically, to turn any container, like a DIV , a NAV, etc, you need to use the display property to the value of "flex", then you'll be able to apply the flex properties to their children.

Here is an example for a nav the html code:

         <a>Hello</a>
         <a>its</a>

        <a>Me</a>
        <a></a>

</nav>

The Css_

display:flex;
}
nav a{
align-self:center;
}

Hope this helps

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,526 Points

Hi Deon Cole

flex is not a CSS property. To create a flexbox container, you would use the display property and the flexbox value. Take a moment and review this video on how to create a flexbox container (Guil describes the CSS starting at ~1:42).

:) :dizzy: