老师检查下,代码编写是否规范
# 具体遇到的问题
# 报错信息的截图
# 相关课程内容截图
# 尝试过的解决思路和结果
# 粘贴全部相关代码,切记添加代码注释(请勿截图)
在这里输入代码,可通过选择【代码语言】突出显示
<!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 type="text/css">
*{
margin: 0;
padding: 0;
}
.box{
width: 400px;
height: 300px;
overflow: hidden;
margin: 50px auto;
position: relative;
}
.box p{
width: 400px;
height: 50px;
line-height: 50px;
text-align: center;
position: absolute;
bottom: -50px;
left: 0;
background-color: rgba(0,0,0,.4);
color: white;
transition: bottom 1s linear 0s;
}
.box:hover p{
bottom:0px
}
</style>
</head>
<body>
<div class="box">
<img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1604909005112&di=9b39d9e526856b78cb36a361be799028&imgtype=0&src=http%3A%2F%2Fa0.att.hudong.com%2F30%2F29%2F01300000201438121627296084016.jpg" alt="">
<p>总裁喵</p>
</div>
</body>
</html>
正在回答
同学你好,效果实现了哦,代码也写的规范,继续加油!
祝学习愉快!
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星