JavaScript 透明背景色
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script src="jquery.min.js"></script>
<script type="text/javascript">
$(function(){
$("img").hover(function(){
$("div,p,a").show();
},function(){
$("div,p,a").hide();
})
})
</script>
<style type="text/css">
div{
color: white;
width: 251px;
height: 423px;
font-size: small;
position: relative;
/* display: none; */
background-color:rgba(255,104,49,0.6);
bottom: 442px;
left: 4px;
}
p{
position: relative;top: 150px;
text-align: center;
font-size: small;
}
a
{
text-decoration: none;
color: white;
position: relative;
top: 360px;
left: 200px;
}
</style>
</head>
<body>
<img src="img/1-1.png" />
<div>
<p>西优里格 蕾丝镂空女式衬衫 韩版长袖衬衣</p>
<a href="#">去购买></a>
</div>
</body>
</html>
- 效果图 图片自己改
在这里插入图片描述