CSS 边距 margin-bottom 属性
描述
margin-bottom属性设置元素底部的边距宽度。
可能的值
- length − 任何长度值。
 - 
percentage − 边距的宽度相对于元素的包含块的宽度计算。
 - 
auto − 默认值,让浏览器自动设置边距。
 
适用于
所有HTML元素。
DOM语法
object.style.marginBottom = "5px"
示例
这是一个例子 –
<html>
   <head>
   </head>
   <body>
      <p style = "margin-bottom: 15px; border:1px solid black;">
         This is a paragraph with a specified bottom margin
      </p>
      <p style = "margin-bottom: 5%; border:1px solid black;">
         This is another paragraph with a specified bottom margin in percent
      </p>
   </body>
</html>
这将产生以下结果−

极客教程