Blogger Information
Blog 25
fans 0
comment 0
visits 18805
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
盒子外边框
℃级的博客
Original
702 people have browsed it

实例

/*同级塌陷*/
.box{
	width:100px;
	height:100px;
	background-color:lightblue;
	margin-bottom: 40px;
}
.box1{
	width:100px;
	height:100px;
	background-color:lightcoral;
    margin-top:40px;
}

运行实例 »

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

实例

/*嵌套传递,*/
.box{
	width:300px;
	height:300px;
	background-color:lightblue;
	
}
.box1{
	width:100px;
	height:100px;
	background-color:lightcoral;
    
}
.box{
   padding-top:100px;
   height: 200px;
}

运行实例 »

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

体会:margin和padding在两个盒子中使用区别,margin用于两个并列的盒子间的调节,padding用于嵌套在一起的盒子间的调节

实例

/*自动挤压*/
 .box{
	width:100px;
	height:100px;
	background-color:lightblue;
	margin-left:100px;
	margin-left:-50px;
/* 	margin-left: auto;
margin-right:auto; */
	margin:0 auto;

}

运行实例 »

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


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
Author's latest blog post