鼠标hover时改变图片透明度和颜色(方法二)

鼠标hover时改变图片透明度和颜色(方法二)

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<script src="js/jquery-3.1.1.min.js"></script>
<style>
div{
position: relative;
width:352px ;
height: 274px;
overflow: hidden;
}
img {
position: absolute;
}
p {
position: absolute;
width: 100%;
height: 100%;
background-color: rgba(255,60,99,0.3);
line-height: 260px;
padding-left: 120px;
display: none;
}
div:hover >p{
display: block;
}
</style>
</head>
<body>
<div>
<img src="img/1.png">
<p><a href="#">this ia s monster</a></p>
</div>

</body>
</html>

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-11
  • 2021-08-09
  • 2022-12-23
  • 2021-07-09
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-07
  • 2022-12-23
相关资源
相似解决方案