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;
50%;
}
span { 200px;}
</style>
<body>
<div class="singal">singal</div>
<br/>
<span>inline</span>