麻烦老师检查下代码谢谢
来源:2-9 自由编程
菜鸟瑞
2021-03-17 13:10:30
<!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>
*{
padding: 0;
margin: 0;
}
.box{
width: 1200px;
height: 244px;
margin: 10px auto;
border: 1px solid #000;
}
.box ul{
list-style: none;
overflow: hidden;
}
.box ul li{
float: left;
width: 300px;
height: 244px;
margin-right: 100px;
position: relative;
}
.box ul li .info{
width: 300px;
height: 30px;
background-color: rgba(12, 12, 12, 0.5);
position: absolute;
color: rgb(0, 236, 79);
line-height: 30px;
text-align: center;
bottom: -30px;
opacity: 0;
transition: all 1s linear 0s;
}
.box ul li:hover .info{
opacity: 1;
bottom: 0;
}
</style>
</head>
<body>
<div class="box">
<ul>
<li>
<img src="/duck.png" alt="">
<div class="info">大黄鸭</div>
</li>
<li>
<img src="/duck.png" alt="">
<div class="info">小黄鸭</div>
</li>
<li>
<img src="/duck.png" alt="">
<div class="info">小小鸭</div>
</li>
</ul>
</div>
</body>
</html>
1回答
同学你好,代码实现效果很棒,没问题。继续加油,祝学习愉快!
相似问题