1.实验:盒子
2.IDE:VSCODE
3.记录:
margin(外边距)
border(边框)
padding(内边距)
4.代码:
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>盒子模型</title>
</head>
<style>.demo{background-color: blueviolet;height: 70px;width: 70px; }.demo{color: brown;}/* border */.demo{border-width: 10px;border-color: brown;border-style: solid;}/* 左外边框 margin*/.box_leftborder{margin-left: 50px;} /*左外边距50px*/.box_leftborder{border-left: 5px;border-color: blue;border-style: solid;}.box_leftborder{border-right: 5px;border-style: solid;}/* 内边框 padding*/.demo{padding: 30px;}
</style>
<body><!-- 块内元素 --><div class="demo">box</div> <div class="box_leftborder">盒子</div>
</body>
</html>