background-size: cover;
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
.demo,.img,.mask,.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;
top: 0;
left: 0;
}
.mask
{
color: rgba(255,255,255,0);
transition: all .9s linear ;
}
.info{
text-align: center;
margin-top: 50%;
transform: translateY(-50%);
}
.border{
border: 10px solid #072256;
border-left-color: #E07515;
border-top-color: #E07515;
box-sizing:border-box;
transition: all .9s ease-in ;
}
.demo:hover .mask{
background-color:rgba(0,0,0,.5);
color: rgba(255,255,255,1);
}
.demo:hover .border{
transform: rotate(180deg);
}
</style>
</head>
<body>
<a href="">
<div style="background: url(518.jpg);"></div>
<div>
<div>
<h3>凤凰传奇</h3>
<p>高品质.mp4</p>
</div>
</div>
<div></div>
</a>
</body>
</html>
为什么背景图无法全显 居中?