麻烦老师查看作业,谢谢。

来源:2-9 自由编程

DanielDu87

2022-02-01 17:35:43

<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>标题</title>
<style>
* {
margin: 0;
padding: 0;
}

.box {
margin: 40px auto;
width: 400px;
height: 400px;
position: relative;
overflow: hidden;
}

.box .shadow {
position: absolute;
background-color: rgba(0, 0, 0, 0.3);
width: 400px;
height: 50px;
bottom: -50px;
transition: bottom ease-in-out 0.4s 0s;
font-size: 25px;
color: white;
text-align: center;
line-height: 50px;
}

.box img {
position: absolute;
bottom: 0;
width: 400px;
}

.box:hover p {
bottom: 0;
}
</style>
</head>
<body>
<div class="box">
<img src="../images/duck.png" alt="duck.png">
<p class="shadow">这是一只小黄鸭</p>
</div>
</body>
</html>


写回答

1回答

好帮手慕星星

2022-02-05

同学你好,代码实现效果很棒,继续加油,祝学习愉快!

0

0 学习 · 17877 问题

查看课程