2012-02-10 151 views
0

我基本上测试CSS按钮在ul的导航中使用,我可以让伪类去做我想要的大部分事情,但我似乎无法获得背景色来改变! 这可能是我应该看到的那些愚蠢的东西之一,但也许别人会看到我的错误。a:主动不改变背景颜色

a:Active { 
    /* General */ 
    /* Size */ 
    height: 30px; 
    width: 100px; 
    background-position:0 2px; 
    color:#F00; 

    /* Stroke */ 
    border: 1px solid hsla(0.0, 0.0%, 42.0%, 0.52); 
    -moz-border-radius: 0px; /* FF1-3.6 */ 
    -webkit-border-radius: 0px; /* Saf3-4, iOS 1-3.2, Android <1.6 */ 
    border-radius: 0px 0px 0px 0px; /* Opera 10.5, IE9, Saf5, Chrome, FF4, iOS 4, Android 2.1+ */ 

    /* Label */ 
    font-family: "Lucida Grande","Verdana","Arial","sans-serif"; 
    font-size: 0.9em; 
    text-align: center; 
    font-weight:normal; 
    display:block; 

    /* Shadow & Inner Shadow */ 
    box-shadow:inset 0px 0px 2px hsla(0.0, 0.0%, 65.9%, 0.58); 

    /* Opacity */ 
    opacity: 1.000; 
} 
+1

您没有在您提供的代码中的任何位置设置背景。而'a:主动'应该是'a:主动' – 2012-02-10 07:11:19

+0

http://pastebin.com/mLUjgQhz 以下是完整的东西, – andy 2012-02-10 10:20:48

+0

没有人知道答案? – andy 2012-02-10 20:39:32

回答

0

您需要在您的CSS中有background-color!你只有color

+0

是的,我曾尝试过 - 甚至背景颜色:#不起作用 – andy 2012-02-10 10:00:39

0

你的背景色在哪?

我猜你的错误是color: #F00;这应该是background-color: #F00;,也什么桑迪普说。

+0

这也不工作,值得注意的是,标记的其他部分,像背景位置! – andy 2012-02-10 10:01:33

+0

然后可能是别的什么不对。 – elclanrs 2012-02-10 16:41:45