hover给图片加遮罩

来源:互联网 发布:网上比价软件 编辑:程序博客网 时间:2024/06/05 11:44
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>hover给图片加遮罩</title>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
<style type="text/css">
.picbox {
    width: 100%;
    height: 0;
    padding-bottom: 133%;
    float: left;
    position: relative;
    margin-bottom: 8px;
}
.picbox img {
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
}
.picbox:hover .video {
    display: block;
}
.video{
    position: relative;
    top: -70px;
    display: none;
}
</style>
</head>
<body>
<div class="picbox">
<img src="44.jpg" alt="123">
<img class="video" src="video.png" alt="">
</div>
</body>
</html>