css浮动3-5编程练习

来源:3-5 编程练习

qq_精慕门6417434

2021-02-20 23:21: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;
box-sizing:content-box;
}
.top{
width:400px;
height:200px;
top:100px;
left:200px;
position:absolute;
background-color: yellow;
}
</style>
</head>
<body>
<div class="content">
<div class="top"></div>
</div>
</body>
</html>


写回答

1回答

好帮手慕珊

2021-02-21

同学你好,实现效果是正确的!也可以参考本小节问答区其他同学的代码,使用padding和margin完成,实现方式有多种,多尝试呦~

祝学习愉快!

0

0 学习 · 16556 问题

查看课程