Correcting teacher:天蓬老师
Correction status:qualified
Teacher's comments:盒模型知识点众多, 咱们学的只是重点而已
老师用的是float,这边我使用flex实现同样效果
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link rel="stylesheet" href="x.css" />
</head>
<body>
<div class="header">细说盒模型</div>
<div class="container">
<div class="left">步子不非得迈得大,只要朝着正确的方向前进就行。</div>
<div class="right"></div>
</div>
</body>
</html>
:root {
font-size: 0.625em;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.container {
display: flex;
.left {
width: 70%;
height: 16em;
background-color: rgb(36, 36, 36);
}
.right {
background-color: blue;
width: 29%;
margin-left: 1%;
}
}
:root {
font-size: 0.625em;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.container {
display: flex;
.left {
width: 70%;
height: 16em;
background-color: rgb(36, 36, 36);
}
.right {
background-color: blue;
width: calc(30% - 1em);
margin-left: 1em;
}
}
上面两方法的异同之处可以对比看出