我的CSS是这样的:重写链接样式
A:link { text-decoration: none; color: White; border-bottom:1px dotted white; font-style:italic;}
A:visited { text-decoration: none; color: White; border-bottom:1px dotted white; font-style:italic;}
A:active { text-decoration: none; color: White; border-bottom:1px dotted white; font-style:italic;}
A:hover { text-decoration: none; color: white; border-bottom:1px solid white; font-style:italic; }
#mainmenu A:link { text-decoration: none; }
#mainmenu A:visited { text-decoration: none; }
#mainmenu A:active { text-decoration: none; }
#mainmenu A:hover { text-decoration: underline; color: white; }
和HTML我有:
<div id="mainmenu">
<a href="link here">link</a>
</div>
我会认为这菜单项将有没有文字的装饰风格,而是它获取下划线的风格。所以#mainmenu的样式似乎被忽略,它总是采用默认样式。
我错过了什么吗?
什么broswer你在查看此? –
firefox 7,但在IE中相同 –
'#id'样式优先于'.class'样式,它优先于'a'对象样式。你可能想让自己了解层叠样式表的层叠部分:) –