CSS 设计模式和旧版 IE6 的问题
http://ci2.totalshopuk.com 的顶部导航左侧有分隔线,这意味着最后一个链接没有有一个分隔器。我想删除第一个分隔线或在最后添加一个分隔线。
我复制了 .navmenuitem1 样式并制作了一个新的 .navmenuitemfirst1 并删除了背景,但奇怪的是第一个链接被放在了其余链接上方的一行上!? (即使是该样式的直接副本也会做同样的事情)。
示例:-
<ul class="navmenu1">
<li class="navmenuitemfirst1"><a href="/">Home</a></li>
<li class="navmenuitem1"><a href="/download">Download</a></li>
<li class="navmenuitem1"><a href="/about">About Us</a></li>
<li class="navmenuitem1"><a href="/faq">FAQ</a></li>
<li class="navmenuitem1"><a href="/newsletter">Newsletter</a></li>
<li class="navmenuitem1"><a href="/license">License</a></li>
<li class="navmenuitem1"><a href="/contact">Contact Us</a></li>
</ul>
最后,在 IE6 中没有显示任何背景图像,我只是将颜色作为背景...但是原始表格设计上的背景位于 http://www.totalshopuk.com 显示正确。
非常感谢任何帮助!
-- 复制所有 .navmenuitem 样式修复了分隔符问题 --
.navmenuitemfirst,.navmenuitem {
display: inline;
margin: 0;
padding: 0;
}
.navmenuitemfirst a {
color: #FFF;
font-size: 16px;
padding-left: 30px;
padding-right: 30px;
}
.navmenuitem a {
background: url(../images/navdivider.png) no-repeat;
color: #FFF;
font-size: 16px;
padding-left: 30px;
padding-right: 30px;
}
.navmenuitemfirst a:hover,.navmenuitem a:hover {
color: #E64D29;
}
The top navigation at http://ci2.totalshopuk.com has dividers on the left which means the last link doesn't have a divider. I would either like to remove the first divider or add one at the end.
I copied the .navmenuitem1 style and made a new one .navmenuitemfirst1 and removed the background but strangely the first link was put on a line above the rest!? (even a straight copy of the style does the same thing).
Example:-
<ul class="navmenu1">
<li class="navmenuitemfirst1"><a href="/">Home</a></li>
<li class="navmenuitem1"><a href="/download">Download</a></li>
<li class="navmenuitem1"><a href="/about">About Us</a></li>
<li class="navmenuitem1"><a href="/faq">FAQ</a></li>
<li class="navmenuitem1"><a href="/newsletter">Newsletter</a></li>
<li class="navmenuitem1"><a href="/license">License</a></li>
<li class="navmenuitem1"><a href="/contact">Contact Us</a></li>
</ul>
Lastly, in IE6 none of the background images show, I just get the colour as the background... however the backgrounds on the original table design at http://www.totalshopuk.com show correctly.
Any help is very much appreciated!
-- Duplicating all .navmenuitem styles fixed the divider issue --
.navmenuitemfirst,.navmenuitem {
display: inline;
margin: 0;
padding: 0;
}
.navmenuitemfirst a {
color: #FFF;
font-size: 16px;
padding-left: 30px;
padding-right: 30px;
}
.navmenuitem a {
background: url(../images/navdivider.png) no-repeat;
color: #FFF;
font-size: 16px;
padding-left: 30px;
padding-right: 30px;
}
.navmenuitemfirst a:hover,.navmenuitem a:hover {
color: #E64D29;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好的,第一个问题的答案可能与 a 有关:
http://jsfiddle.net/9DTTd/ 1/
我为 .navmenuitemfirst1 a 创建了一个新类
,当背景样式位于 a 中时(a 是带有背景的块),您可能只应用了新类。我看不到任何线路错误,但请检查并告诉我。这也可能回答关于背景的第二个问题,但我没有 ie6 来检查它:3
编辑:我后来注意到为什么它不起作用,愚蠢的我。该类还需要具有内联属性:
Ok, the answer to your first question can have to do with the a:
http://jsfiddle.net/9DTTd/1/
I created a new class for .navmenuitemfirst1 a
You might have been applying just the new class, when the background style is in the a (the a is a block with a background). I can't see any error with lines, but check it and let me know. This might also answer the second concern about the background, but I don't have ie6 to check it :3
EDIT: I later noticed why it wasn't working, silly me. The class needed to have also the inline property:
可能 .navmenuitem1 有一个position:relative 和 float:left 而 .navmenuitemfirst1 没有。正如 utopicam 要求为它制作一个 jsfiddle ,这样我们就可以用它检查 css 。
Probaly the .navmenuitem1 has an position:relative and float:left and the .navmenuitemfirst1 hasn't. As utopicam asked make an jsfiddle for it so we could check the css with it.