css 颜色置顶 20

我想鼠标移到图片上的时候。。有层颜色在上面(颜色设置透明度,不完全挡住图片)。。选中的时候又换成另一个颜色。... 我想鼠标移到图片上的时候。。有层颜色在上面(颜色设置透明度,不完全挡住图片)。。选中的时候又换成另一个颜色。 展开
 我来答
匿名用户
2015-05-26
展开全部
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">
<head>
  <title>我是雷锋</title>
  <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
  <meta name="description" content=""/>
<style type="text/css">
.test{
width:50px;
height:50px;
position:relative;
}

.test .top{
position: absolute;
left:0px;
top:0px;
width:50px;
height:50px;
background-color: black;
filter: alpha(opacity=50);
   -moz-opacity: 0.5;
   -khtml-opacity: 0.5;
   opacity: 0.5;
}

.test .top:hover{
background-color: red;
cursor: pointer;
}

.test img{
width:50px;
height:50px;
}
</style> 
</head>
<body>
<div class="test">
<div class="top"></div>
<img src="images/sousuo.png">
</div>
</body>
</html>
追问
放上去的时候颜色是变了。。我选中的时候。。如何再变一种色。。或高亮边框。。我有几个图的。。这个选择的时候。。其它的要去掉高亮边框。。请大神帮忙。谢谢你!
追答
你要的是tab效果的点击以后停留并且变色??????
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式