i have the following code, right now just a logo in a div, but i’m trying to add a few navigation cells that i will later style. the problem is, i can’t seem to get them “in line” with (meaning besides) the logo, they always drop down to the next line. what am i doing wrong?
#header {
position:relative;
padding-top:0px;
width:960px;
margin-left: auto ;
margin-right: auto ;
}
#nav {
padding:0px;
height:20px;
}
#nav ul {
margin:0;
padding:0;
list-style:none;
}
#nav li {
display:inline;
margin:0;
padding:0;
}
<div id="header">
<img src="logo3.png" height="91" width="162">
<div id="nav">
<ul>
<li>nav item 1</li>
<li>nav item 2</li>
<li>nav item 3</li>
</ul>
</div>
</div>
Here, http://jsfiddle.net/PLmSB/1/
Tested in Chromium
You just had to add
Be sure to read this article on Cross-Browser Support for Inline-Block
Otherwise, as @Ana pointed out,
This should work. http://jsfiddle.net/PLmSB/3/