1. 程式人生 > >用css3過濾做遮罩效果

用css3過濾做遮罩效果

clas ont mask isp 過濾 control pos -a -c

<!DOCTYPE html>
<html ng-app="myApp" ng-controller="myController">
<head lang="en">
<meta charset="UTF-8">
<title>CSS3做遮罩</title>
<style>
.all{
width:100%;
height:500px;
background:red;
position: relative;
}
.mask{
width:100%;
height:0;
background:rgba(0,0,0,.5);
position:absolute;
transition: height 1s linear 1s;
}
.all:hover .mask{
height:500px;
display: block;
}
</style>
</head>
<body>
<div class="all">
<div class="mask"></div>
</div>
</body>
</html>

用css3過濾做遮罩效果