CSS margin-bottom

CSS margin-bottom 属性定义与用法

margin-bottom属性设置元素的下边距。

注意: 负值是允许的。

默认值: 0
继承: no
版本: CSS1
JavaScript 语法: object.style.marginBottom="10px"

 

CSS margin-bottom 属性值

描述
auto 浏览器计算下外边距。
length 规定以具体单位计的下外边距值,比如像素、厘米等。默认值是 0px。
% 规定基于父元素的宽度的百分比的下外边距。
inherit 规定应该从父元素继承下外边距。

 

CSS margin-bottom 浏览器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主要浏览器都支持margin-bottom属性。

注意: IE7和更早的版本不支持"inherit"的值。 IE8需要定义!DOCTYPE。 IE9支持"inherit"。

 

CSS margin-bottom 实例

设置一个p元素的下边距:

p {
    margin-bottom:2cm;
}

在线运行

 

相关文章

CSS 教程: CSS 外边距 Margin