CSS margin-bottom 属性
CSS margin-bottom 属性设置元素的下边距
负值是允许的
| 默认值 | 0 |
|---|---|
| 继承 | no |
| 版本 | CSS1 |
| JavaScript 语法 | object.style.marginBottom="10px" |
语法
margin-bottom: auto | *length* | *%* | inherit
属性值
| 值 | 描述 |
|---|---|
| auto | 浏览器计算下外边距 |
| length | 规定以具体单位计的下外边距值,比如像素、厘米等。默认值是 0px |
| % | 规定基于父元素的宽度的百分比的下外边距 |
| inherit | 规定应该从父元素继承下外边距 |
浏览器支持
下表中的数字表示支持该属性的第一个浏览器版本号
| 1.0 | 6.0 | 1.0 | 1.0 | 3.5 |
范例
设置一个 p 元素的下边距
p { margin-bottom:2cm; }
相关文章
CSS 基础教程 CSS margin