“Pr margin bottom”的版本间差异
本页内容
(创建页面,内容为“{{DISPLAYTITLE:margin-bottom}}2 = CSS margin-bottom 属性 = 设置一个p元素的下边距: <sample title="" desc="" lang="html" hererun="1"> p { margin-bottom:2cm; } </sample> <run name=""> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>小白教程(xiaobai.wang)</title> <style> p.ex1 {margin-bottom:2cm} </style> </head> <body> <p>一个没有指定边距大小的段落。</p> <p class="ex1">…”) |
无编辑摘要 |
||
第59行: | 第59行: | ||
{| class="table table-striped table-hover" | {| class="table table-striped table-hover" | ||
! 属性 | ! 属性 | ||
! | ! Chrome | ||
! | ! Internet Explorer / Edge | ||
! | ! Firefox | ||
! | ! Safari | ||
! | ! Opera | ||
|- | |- | ||
| margin-bottom | | margin-bottom |
2022年8月19日 (五) 04:31的版本
CSS margin-bottom 属性
设置一个p元素的下边距:
示例
p
{
margin-bottom:2cm;
}
属性定义及使用说明
margin-bottom属性设置元素的下边距。
注意: 负值是允许的。
默认值: | 0 |
继承: | no |
版本: | CSS1 |
JavaScript 语法: | object.style.marginBottom="10px" |
浏览器支持
表格中的数字表示支持该属性的第一个浏览器版本号。
属性 | Chrome | Internet Explorer / Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
margin-bottom | 1.0 | 6.0 | 1.0 | 1.0 | 3.5 |
属性值
值 | 描述 |
---|---|
auto | 浏览器计算下外边距。 |
length | 规定以具体单位计的下外边距值,比如像素、厘米等。默认值是 0px。 |
% | 规定基于父元素的宽度的百分比的下外边距。 |
inherit | 规定应该从父元素继承下外边距。 |
相关文章
CSS 教程: CSS Margin