需要在css的滑动门菜单中更改列表项的背景颜色

时间:2010-10-29 14:09:06

标签: css

这看起来很简单,但是我无法在css的滑动门菜单中获取列表项的背景颜色来进行更改。我已经将左边框(变为绿色)和每个列表项的文本(变为白色)更改了,但我无法更改背景颜色。这是代码:

.slidedoormenu
{
    list-style-type: none;
    margin: 0;
    padding: 0;
    width: 180px; /* width of menu (don't forget to add border with below!) */
    border-left: 8px solid #007f00; /* thick left border of menu */     
}
.slidedoormenu li
{
    border-bottom: 1px solid #885b5c; /* Gray border beneath each menu item */
}
.slidedoormenu li a
{
    background: white url(media/vstrip.gif) repeat-y left top; /* Background image positioned to the left(v) top(h) corner initially */
    font: bold 16px "Lucida Grande" , "Trebuchet MS" , Verdana;
    display: block;
    color: white;
    width: auto;
    border-bottom: 1px solid white; /* White border beneath each menu item link, to add depth */
    padding: 7px 0; /* Vertical (top/bottom) padding for each menu link */
    text-indent: 8px;
    text-decoration: none;
}
.slidedoormenu li a:visited, .slidedoormenu li a:active
{
    color: white;
}
.slidedoormenu li a:hover
{
    background-position: -387px 0; /* Shift background image horizontally 387px, or the start of the 2nd background image */
}
.slidedoormenu li.lastitem, .slidedoormenu li.lastitem a
{
    border-bottom-width: 0; /* For last menu item within menu, remove bottom border */
}
.slidedoormenu li.lastitem a
{
    padding: 8px 0; /* increase vertical border of last menu link by 2px (default is padding: 7px 0) to account for removed border width */
}

1 个答案:

答案 0 :(得分:0)

不明白为什么这不起作用。

.slidedoormenu li{
background-color:#3a8f07;
border-bottom: 1px solid #885b5c; /* Gray border beneath each menu item */}