求大神帮我查错!感谢
我是按照老师一步步来的。可是发现两个问题:1,遮罩层很小,而且偏左上。2,border无法实现过度旋转效果。求大神帮我改改。
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<meta name=description content="css3">
<meta name=viewport content="width=device-width, initial-scale=1">
<title>css3 hover</title>
<style type="text/css">
.demo,.img,.border{
width:300px;
height:300px;
border-radius:50%;
}
.demo{
position: relative;
display: block;
}
.img{
background-size: cover;
background-position: 50% 50%;
}
.mask,.border{
position: absolute;
left:0;
top:0;
}
.mask{
text-align: center;
color:rgba(255,255,255,0);
border-radius: 50%;
-webkit-transform: all 0.5s ease-in;
-moz-transform: all 0.5s ease-in;
-ms-transform: all 0.5s ease-in;
-o-transform: all 0.5s ease-in;
transform: all 0.5s ease-in;
}
.info{
margin-top: 50%;
-webkit-transform: translateX(25%);
-moz-transform: translateX(25%);
-ms-transform: translateX(25%);
-o-transform: translateX(25%);
transform: translateX(25%);
}
.border{
border:10px solid #072256;
border-left-color: #e07514;
border-top-color:#e07514;
box-sizing: border-box;
-webkit-transform: all 0.5s ease-in;
-moz-transform: all 0.5s ease-in;
-ms-transform: all 0.5s ease-in;
-o-transform: all 0.5s ease-in;
transform: all 0.5s ease-in;
}
.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);
}
</style>
</head>
<body>
<a href="#" class="demo">
<div class="img" style="background-image: url(http://f10.topitme.com/o/201101/26/12960352758915.jpg)"></div>
<div class="mask">
<div class="info">
<h3>beautiful day</h3>
<p>description goes here</p>
</div>
</div>
<div class="border"></div>
</a>
</body>
</html>