老师麻烦检查一下作业
来源:2-9 自由编程
慕的地9440514
2022-10-01 15:58:38
相关代码:
<!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>
*{margin: 0;padding: 0;}
div{
margin: 30px auto;
width: 1000px;
position: relative;
overflow: hidden;
height: 800px;
}
div img{
width: 1000px;
height: 800px;
}
div p{
width: 1000px;
height: 200px;
box-sizing: border-box;
background-color: rgba(0, 0, 0, 0.5);
color: white;
padding: 80px 0 0 30px;
font-size: 60px;
position: absolute;
top: 800px;
transition: top 0.5s linear 0s;
}
div:hover p{
top: 600px;
}
</style>
</head>
<body>
<div>
<img src="img/duck.png" alt="">
<p>这是一只小黄鸭</p>
</div>
</body>
</html>1回答
同学你好,代码是对的,很棒,祝学习愉快!
相似问题