开发者

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 */

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜