CSS 盒模型

CSS 盒子模型

盒子内容--》盒子填充--》盒子边框--》盒子边距
每个属性又有上,下,左,右,是个部分。


content padding border margin

content = width * height

padding border margin都有 left, right, bottom, left.


width : <length> (px em) | <percentage> | auto | inherit
percentage, 大部分参照物是父元素。

 

<style type="text/css">
	
div, span {
	background-color: #ccc;
	width: 50%;
}

span { width: 200px;}
</style>

<body>

<div class="singal">singal</div>
<br/>
<span>inline</span>

  

 

posted on 2015-10-07 21:07  HGonlyWJ  阅读(109)  评论(0编辑  收藏  举报

W3C中国
阮老师的网络日志
canvas
runoob
迷渡
并发编程网
原生JS例子
前端外刊评论