鼠标经过背景显示出来,离开隐藏
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.box{
position: relative;
width: 222px;
height: 220px;
margin: 30px auto;
}
.box .one{
display: none;
position: absolute;
top: 0;
left: 0;
width: 222px;
height: 220px;
background: rgba(0, 0, 0, .4) url(../imgages/arr.png) no-repeat center center;
}
.box a:hover .one{
display: block;
}
</style>
</head>
<body>
<div class="box">
<a href="#">
<div class="one"></div>
<img src="../imgages/sun.jpg" alt="" width="200px">
</a>
</div>
</body>
</html>