一般自定义样式如:
a.test:hover{
  color:red;
}
可以实现鼠标移上的时候变色,
如果样式名称是" #fu a "的话应该怎么实现连接变色呢?
我试了使用:
a.#fu:hover{
  color:red;
}
无法实现连接变色,请问这里的CSS应该如何写?

解决方案 »

  1.   

    用继承吧a:hover{
      color:red;
    }
      

  2.   

    楼主写反了啊
    你的.test 在html里面表示的
    <span class="test">....</span>
    但是你的 #fu
    在html的表示的
    <span id="fu">...</span>所以 你只要修改你的代码:
    .test a:hover{
      color:red;
    }
    #fu a:hover{
      color:red;
    }都一样可以实现变色
      

  3.   

    还是不行啊
    我贴我的代码:
    <html>
    <head>
    <style type="text/css">
    <!--
    a.test:hover{
    color:red;
    }
    #test2 a.hover:{
    color:red;
    }
    -->
    </style>
    </head>
    <body>
    <a href="" class="test">test</a>
    <div id="test2"><a href="">test</a></div>
    </body>
    </html>
      

  4.   

    a.#fu:hover{
      color:red;
    }
    应该这样写
    #fu a:hover{
      color:red;
    }