效果怎么不对?
来源:3-5 编程练习
warren_au
2020-05-23 14:01:01
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
.content{
width:800px;
height:400px;
background-color: skyblue;
padding-top:100px;
box-sizing:border-box;
}
.top{
width:400px;
height:200px;
background-color: yellow;
position:absolute;
padding-left:100px;
}
</style>
</head>
<body>
<div class="content">
<div class="top"></div>
</div>
</body>
</html>
1回答
同学你好,按照作业需求,建议同学将.top中的内边距修改为外边距。修改后代码如下所示:
如果我的回答解决了你的疑惑,请采纳!祝学习愉快!
相似问题