Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML How to Make a Website Styling Web Pages and Navigation Build Navigation with Unordered Lists

INLINE BLOCK

in the "nav li" selector i used the display property and set the value to inline-block, trying to make the nav bar in a line like the video shows you. but for some reason it just wont work.

Hi Alexander Hernandez!

I think it would be easier to answer your question if you post just a tad bit more information about the problem, for instance your code would help very much!

8 Answers

yayyyy I fixed it!

It should work with "inline-block" - can you share the code? Sometimes I've had problems with a width set to 100% keeping the inline-block from working, and of course there are almost always typos that can mess things up (sometimes on the line before or after...)

to show you my code, do i just copy and paste???

Hey, this tutorial will show you how to properly post your code within the forum https://teamtreehouse.com/community/posting-code-to-the-forum

nav {
    text-align:center;
    padding: 10px 0;
    margin:  20px 0 0;
}

nav ul {
  list-style: none;
  margin: 0 auto;
  padding: 0;
}

nav ul li {
  display: inline-block;
}

here is what i put

I tried this out with an HTML file that looks like:

  <nav>
    <ul>
      <li>Item 1</li>
      <li>Item 1</li>
      <li>Item 1</li>
      <li>Item 1</li>
      <li>Item 1</li>
    </ul>
  </nav>

And it seems to work just fine. In the videos I remember "nav" was a class rather than an element though, in which case you need to use ".nav" in your css instead.

<nav>
        <ul id="gallery" >
        <li><a href="index.html" class="selected">Portfolio</a></li>
         <li><a href="about.html">About</a></li>
         <li><a href="contact.html">contact</a></li>
        </ul>
      </nav>

is there anything here in my html that could be causing the problem??

Not that I can see, when I try running your code in my browser it lines up fine. Maybe double check the link for the css file, a typo there might be keeping the page from "seeing" your css.