蒙奇-D-HT
2016-11-19 11:08:49
css3的transform设置动态效果
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>css3 Hover</title>
<style type="text/css">
.demo,.img,.border,.mask{
width: 300px;
height: 300px;
}
.demo{
display: block;
position: relative;
margin:50px auto;
}
.img{
background-repeat: no-repeat;
background-size: cover;
background-position: center center;
border-radius: 50%;
}
.border{
position: absolute;
border: 10px solid #072256;
border-left-color:#E07514;
border-top-color:#E07514;
top: 0;
left: 0;
border-radius: 50%;
-webkit-transition:all .5s ease-in;
transition:all .5s ease-in;
-webkit-box-sizing:border-box;
box-sizing:border-box;
}
.mask{
position: absolute;
top: 0;
left: 0;
border-radius: 50%;
-webkit-transition:all .5s ease-in;
transition:all .5s ease-in;
color:rgba(255,255,255,0);
}
.demo:hover .mask{
background-color:rgba(0,0,0,0.5);
color:rgba(255,255,255,1);
}
.demo:hover .border{
-webkit-transform:rotate(180deg);
transform:rotate(180deg);
}
.info{
position: absolute;
width: 100%;
top: 50%;
left: 0;
text-align: center;
-webkit-transform:translateY(-50%);
}
</style>
</head>
<body>
<a href="#" class="demo">
<div class="img" style="background-image:url(http://ww3.sinaimg.cn/mw690/9c7cd2cdjw1e60hntjcq2j211y0lcq5e.jpg)"></div>
<div class="mask">
<div class="info">
<h3>BEATIFUL DAY</h3>
<p>Description goes here</p>
</div>
</div>
<div class="border"></div>
</a>
</body>
</html></pre>
<p>
请下载代码后再发表评论
相关代码
最近下载
最近浏览
puregod LV3
6月2日
ilovecode521 LV6
2024年12月6日
Osit888 LV12
2023年12月7日
cys18318001508 LV12
2023年11月9日
9323249323 LV13
2023年7月25日
张锦深 LV1
2023年6月13日
lzl111213 LV1
2023年3月11日
孟子大叔 LV7
2023年2月6日
xie_code
2022年5月1日
暂无贡献等级
wwyyff123 LV2
2021年7月1日





