89 lines
1.6 KiB
HTML
89 lines
1.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
<title>盒子模型</title>
|
|
<style>
|
|
body {
|
|
margin: 0;
|
|
}
|
|
.box-1 {
|
|
width: 150px;
|
|
height: 150px;
|
|
background: red;
|
|
display: inline-block;
|
|
|
|
|
|
|
|
|
|
/* margin-top: 40px;
|
|
margin-right: 40px;
|
|
margin-bottom: 40px;
|
|
margin-left: 40px; */
|
|
|
|
/* 四个方法同时设置 */
|
|
/* margin: 10px; */
|
|
|
|
/* 上下 左右 */
|
|
/* margin: 20px 30px; */
|
|
|
|
/* 上 左右 下 */
|
|
/* margin: 10px 20px 30px; */
|
|
|
|
/* 上 右 下 左 */
|
|
/* margin: 10px 20px 30px 40px; */
|
|
|
|
/* padding 和margin规律一样 */
|
|
|
|
/* border: 1px solid #000;
|
|
|
|
border-left-width: 5px;
|
|
border-right-width: 10px;
|
|
border-top-width: 15px;
|
|
border-bottom-width: 20px;
|
|
|
|
border-left-style: dashed;
|
|
border-right-style: groove;
|
|
border-top-style: double;
|
|
border-bottom-style: solid;
|
|
|
|
border-left-color: blue;
|
|
border-right-color: burlywood;
|
|
border-top-color: aqua;
|
|
border-bottom-color: brown; */
|
|
|
|
border-top: 20px solid #000;
|
|
border-right: 20px solid #ff0;
|
|
border-bottom: 20px solid #8d8d88;
|
|
border-left: 20px solid blue;
|
|
|
|
|
|
|
|
|
|
}
|
|
.box-2 {
|
|
width: 150px;
|
|
height: 150px;
|
|
background: yellow;
|
|
display: inline-block;
|
|
}
|
|
|
|
|
|
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
|
|
|
|
<div class="box-1">
|
|
box-1
|
|
</div>
|
|
<div class="box-2">
|
|
box-2
|
|
</div>
|
|
|
|
</body>
|
|
</html> |