CSS margin-bottom 屬性
定義和用法
margin-bottom 屬性設(shè)置元素的下外邊距。
注釋:允許使用負(fù)值。
默認(rèn)值: | 0 |
---|---|
繼承性: | no |
版本: | CSS1 |
JavaScript 語法: | object.style.marginBottom="10px" |
瀏覽器支持
所有主流瀏覽器都支持 margin-bottom 屬性。
注釋:任何的版本的 Internet Explorer (包括 IE8)都不支持屬性值 "inherit"。
可能的值
值 | 描述 |
---|---|
auto | 瀏覽器計(jì)算下外邊距。 |
length | 規(guī)定以具體單位計(jì)的下外邊距值,比如像素、厘米等。默認(rèn)值是 0px。 |
% | 規(guī)定基于父元素的寬度的百分比的下外邊距。 |
inherit | 規(guī)定應(yīng)該從父元素繼承下外邊距。 |
TIY 實(shí)例
- 設(shè)置文本的下外邊距 1
- 本例演示如何使用厘米值來設(shè)置文本的下外邊距。
- 設(shè)置文本的下外邊距 2
- 本例演示如何使用百分比值來設(shè)置文本的下外邊距。