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 Understanding Flexbox Flex Container Challenge

how can i write a main-nav in a container ?


<!DOCTYPE html>
    <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">
      <ul class="main-nav">
        <li class="name"><a href="#">My Site</a></li>
        <li><a href="#">About</a></li>
        <li><a href="#">Work</a></li>
        <li><a href="#">Contact</a></li>
/* Complete the challenge by writing CSS below */
.container {

1 Answer

Garret Witzenburg
Garret Witzenburg
Front End Web Development Techdegree Student 6,161 Points

In the challenge you need to target the main-nav class (.main-nav), and put it in a flex container. The correct answer would be to put:

.main-nav {
  display: flex;

in your css file.

Austin Whipple
Austin Whipple
29,687 Points

Formatted your CSS! Be sure to check out the Markdown Cheatsheet for handy formatting tips.