#denglu:hover{background-color:#CCCCCC ;color:red;}
这里你需要用background-color,因为用background的话你需要写上图片路径的,如果不写相当于没有背景图片。
同时使用背景图片和背景颜色可以实现,需要如下代码:
.test{background:url("图片链接") center center no-repeat; background-color:#000;}
或
.test{background:url("图片链接") #000000 center center no-repeat;}
注意:
背景图片需要在背景颜色之前;
需要设置多个值时使用background,只需图片链接时可直接用background-img链接;
背景图片加 z-index:-1