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 trialAlexander Hernandez
900 PointsINLINE 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.
8 Answers
Alexander Hernandez
900 Pointsyayyyy I fixed it!
Karen Freeman-Smith
29,248 PointsIt 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...)
Alexander Hernandez
900 Pointsto show you my code, do i just copy and paste???
Reggie Sibley
6,018 PointsHey, this tutorial will show you how to properly post your code within the forum https://teamtreehouse.com/community/posting-code-to-the-forum
Alexander Hernandez
900 Pointsnav {
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
Karen Freeman-Smith
29,248 PointsI 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.
Alexander Hernandez
900 Points<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??
Karen Freeman-Smith
29,248 PointsNot 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.
Reggie Sibley
6,018 PointsReggie Sibley
6,018 PointsHi 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!