老师,为什么我这个小黄鸭移动不了?
来源:2-9 自由编程
阿山123
2021-02-10 11:43:08
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
* {
padding: 0;
margin: 0;
}
.box{
width: 300px;
margin: 30px auto;
position: relative;
height: 240px;
overflow: hidden;
}
.box img{
height: 240px;
width: 300px;
}
.box .pp{
background-color: rgba(0, 0, 0, 0.507);
color: blanchedalmond;
width: 290px;
height: 25px;
line-height: 25px;
padding-left: 10px;
position: absolute;
bottom: 0;
margin-bottom: -25px;
}
.box:hover .pp{
bottom: 0;
margin-bottom: -25px;
}
</style>
</head>
<body>
<div class="box">
<img src="http://127.0.0.1:5500/images_stars/duck.png" alt="">
<p class="pp">我是小黄鸭</p>
</div>
</body>
</html>
2回答
自己找到问题并解决了,很棒,给你点赞,继续加油,祝学习愉快~
阿山123
提问者
2021-02-10
老师,不用了,我自己解决了
相似问题