CSS margin-bottom 屬性
實例
設置一個p元素的下邊距:
p
{
margin-bottom:2cm;
}
{
margin-bottom:2cm;
}
屬性定義及使用說明
margin-bottom屬性設置元素的下邊距。
注意: 負值是允許的。
| 默認值: | 0 |
|---|---|
| 繼承: | no |
| 版本: | CSS1 |
| JavaScript 語法: | object.style.marginBottom="10px" |
流覽器支持
表格中的數字表示支持該屬性的第一個流覽器版本號。
| 屬性 | |||||
|---|---|---|---|---|---|
| margin-bottom | 1.0 | 6.0 | 1.0 | 1.0 | 3.5 |
屬性值
| 值 | 描述 |
|---|---|
| auto | 流覽器計算下外邊距。 |
| length | 規定以具體單位計的下外邊距值,比如像素、釐米等。默認值是 0px。 |
| % | 規定基於父元素的寬度的百分比的下外邊距。 |
| inherit | 規定應該從父元素繼承下外邊距。 |
相關文章
CSS 教學: CSS Margin
