具備的屬性:
margin:外邊距,通常用於調整盒子間的距離,水平居中
border:邊框
padding:內邊距,常用於文本留白,垂直居中
width:內容寬度
height:內容高度
實例分析:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>盒模型</title>
<style type="text/css">
body {
background-color: pink;
}
#boxTest {
height: 200px;
width: 200px;
background-color: white;
margin: 10px;
padding: 10px;
border: 10px black solid;
float: left;
}
</style>
</head>
<body>
<div id="boxTest">我是一個可愛的盒子</div>
<div id="boxTest">我是一個可愛的盒子</div>
<div id="boxTest">我是一個可愛的盒子</div>
</body>
</html>
具體屬性分析