我有以下标题菜单:
%div.header
%div.span-25
= link_to logo, root_path
%div.span-25
%div.headermenu
%ul
- if current_page?(root_path)
%li.currentmenu
= link_to "Home", root_path
- else
%li
= link_to "Home", root_path
- if current_page?(user_path)
%li.currentmenu
= link_to "User", user_path
- else
%li
= link_to "User", user_path
在我的样式表中:
.headermenu {
border-radius:0px 0px 5px 5px;
-moz-border-radius:0px 0px 5px 5px;
margin-top:-5px;
position:relative;
display:block;
height:42px;
font-size:11px;
font-weight:bold;
background:transparent url('darkgray_background.gif') repeat-x top;
font-family:Arial,Verdana,Helvitica,sans-serif;
text-transform:uppercase;
}
.headermenu ul {
margin:0px;
padding:0;
list-style-type:none;
width:auto;
}
.headermenu ul li {
display:block;
float:left;
margin:0 1px 0 0;
}
.headermenu ul li a {
display:block;
float:left;
color:#000;
text-decoration:none;
padding:13px 12px 0 12px;
height:28px;
}
.currentmenu {
color:#fff;
border-radius:5px;
-moz-border-radius:5px;
background:transparent url('darkgray_backgroundOVER.gif') no-repeat top center;
}
因此,当前的标题菜单将突出显示。突出显示的菜单的背景图像是正确的('darkgray_backgroundOVER.gif'),但字体是黑色的(#000),而不是应有的#fff。Firebug 显示当前菜单中取消的字体:
继承自 li.currentmenu element.style { color: #FFFFFF; }
相反,上面显示的是:
.headermenu ul li a { 颜色:#000000; ETC.... }
为什么它不以白色显示字体?黑色几乎看不清。我该怎么做才能使当前菜单的字体为白色并将其他(不是当前菜单)的字体保持为黑色?