下面是我的 HTML 代码
<UL>
<LI>
<LI>
..
<LI>
<a class="upload_menu" href="someLink" ><span>Your Recipes</span></a>
</LI>
<LI>
</UL>
下面是CSS类
.ie7 #navigation .upload_menu {
background-color: #bb3f3f;
color: #FFF;
float: left;
font-size: 12px;
font-weight: bold;
padding: 9px 4px 10px 6px;
text-decoration: none;
!background: url(../../../static-files/images/common/nav-divider.gif) no-repeat right;
border-right: 1px solid #BCDAEE;
}
.ie7 #navigation .upload_menu:hover {
background-color: #bb3f3f;
}
还尝试了下面的CSS
*:first-child +html #navigation .upload_menu {
background-color: #bb3f3f;
color: #FFF;
float: left;
font-size: 12px;
font-weight: bold;
padding: 9px 4px 10px 6px;
text-decoration: none;
!background: url(../../../static-files/images/common/nav-divider.gif) no-repeat right;
border-right: 1px solid #BCDAEE;
}
*:first-child +html #navigation .upload_menu:hover {
background-color: #bb3f3f;
}
但background-color
在开发者工具中可以看到属性本身并没有被采用。