CSS 盒子结构
1、盒子结构内容区:width和height内边距:paddingŸPadding-top:内容和上边框之间距离ŸPadding-right:内容和右边框之间的距离ŸPadding-botttom:内容和下边框之间的距离ŸPadding-left:内容和左边框之间的距离简写ŸPadding:10px 20px 30px 40px ;上右下左ŸPadding:10px 20px 5px; 10px 上 , 20px 左右 5px 下ŸPadding:10px 20px ;10px 上下 20px左右Padding:10px; 上右下左都是10px;
2、外边距:元素和元素之间的距离:ŸMargin-top:上边框往外的部分ŸMargin-right:右边框往外的部分ŸMargin-bottom下边框往外的部分ŸMargin-left: 左边框往外的部分简写ŸMargin:10px 20px 0 40px ; 上 右 下 左;ŸMargin:10px 20px 5px; 10px上 20px 左右 5px 下ŸMargin:10px 20px;10px 上下 20px 左右;ŸMargin 10px; 上右下左 都是10px;
3、边框上边框ŸBorder-top-color:上边框的颜色ŸBorder-top-width:上边框的粗细ŸBorder-top-style:上边框的线型简写Border-top:粗细 线型 颜色;右边框ŸBorder-right-color:右边框的颜色ŸBorder-right-width:右边框的粗细ŸBorder-right-style:右边框的线型Ÿ简写ŸBorder-right:粗细 线型 颜色;上右下左四条边线的样式一样Border:粗细 线型 颜色;网站的布局思想网站的页面就是由如干个盒子堆积(纵向和横向)如果是纵向输入div如果是横向 float
4、浮动:floatFloat:left;Float:right;父元素如果不设置固定高,1在父元素的里面的最下方,放一个<div class=”clearfloat”></div>在css样式中,clear:both;2 在父元素里面加overflow:hidden;