IE6 CSS List as horizontal navigation
Here is my HTML:
<ul class="links">
<li>
<a href="">Home</a>
</li>
<li>
<a href="google.com">Google</a>
</li>
</ul>
CSS:
ul.links {
list-style: none outside none;
margin: 0;
padding: 0;
}
.links li {
float: left;
margin: 8px 4px -2px;
}
When viewing this in IE6 the list it开发者_JAVA百科ems are 100% in width, where as I need them to be as wide as the text they contain plus the padding.
Any ideas?
.links li {
display:inline;
}
.
When you float an element you must apply a width attribute.
width:100px; /* or whatever */
精彩评论