Blogger Information
Blog 34
fans 0
comment 0
visits 26620
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
学习盒子模型的基础原理
罗盼的博客
Original
925 people have browsed it

实例

<!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="content-type" content="text/html" />
	<meta charset="utf-8" />

	<title>盒子模型</title>
</head>

<body>
<div class="box">

</div>
<style>
.box{
  width:200px;
  height: 200px;
  background-color: lightblue;  
  padding-top: 10px;
  padding-right: 20px;
  padding-bottom: 10px;
  padding-left: 20px;
  padding: 10px 20px;/*上下为10px,左右为20px*/
  padding: 10px 20px 30px;/*上为10px,左右为20px,下为30px*/
  padding: 10px;/*上下左右为10px*/
  
  border-top: 10px solid green;
  border-right: 10px solid red;
  border-bottom: 10px dashed grey;
  border-left:10px solid yellow;
  border: 5px solid green;/*上下左右边框均为5px */
  
  
  margin-top: 10px; 
  margin-right:20px;
  margin-bottom: 10px;
  margin-left: 20px;
  margin: 10px 20px;/*上下外边距为10px,左右外边距均为20px */
  
}
</style>
</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

感悟:盒子模型一共包含:content内容,padding内间距透明只有宽,border边框,有属性,可见,margin外边距透明有宽!

Correction status:Uncorrected

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments