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

CSS

css horizontal menu

hi my friends :)

How i make my navigation menu like horizontal menu .

7 Answers

There are some problems with code tag, sorry. Hope you got it.

#nav {
    color: white;
    background-color: black;
    width: 60%;
    height: 50px;
    margin: auto;
    border-radius: 30px;
    text-align: center;
}

a {
    text-decoration: none;
    color: white;
    padding: 10px;
    text-variant: small-caps;
}

ul {
    padding: 13px;
}

li {
    display: inline;
    margin: 0 15px;
}

a:hover {
    border-top: 3px solid white;
}
<body>
     <nav>
         <ul>  
            <li>Home</li>
            <li>About</li>
            <li>Contact</li>
         </ul>
     </nav>
</body>

That is an example nav list, in the css stylesheet you have declare the 'li' elements to be displayed inline

li {
    display: inline;
}

You justa have to keep styling your css.

<body>
    <div id="nav">
        <ul>
            <li><a href="#">Home</a></li>
            <li><a href="#">About</a></li>
            <li><a href="#">Portfolio</a></li>
            <li><a href="#">Services</a></li>
            <li><a href="#">Contact</a></li>
        </ul>
    </div>
</body>

Thank you Andrei , that's so helpful

that code working from me:)

:)

I think what you need is this for your css:

.soc li { display: inline;
float: left; }