CSS padding-bottom 属性值说明
值 | 描述 |
---|---|
length | 它设置PX,PT,CM等中的底部填充。其默认值为0px。 |
% | 它以包含元素的宽度的百分比设置底部填充。 |
initial | 使属性使用其默认值。 |
inherit | 从父母元素继承属性。 |
元素的 padding-bottom 属性设置元素底部的填充空间。
这意味着它定义了元素内容底部所需的空间区域。
元素的内边距可用于计算元素的高度和宽度。
通常,宽度等于内容区域的宽度,包括填充区域的宽度。
例如,如果元素的宽度为“200px”,而该元素的内边距宽度为“40px”,则最终宽度为“240px”。
如果你使用 box-sizing 属性的“border-box”值,这个计算可能会改变。
如果是负值无效。
此属性对内联元素没有任何影响,例如 <span>。
初始值 | 0 |
---|---|
应用于 | 所有元素。当Display属性设置为table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column.时,将报出异常。它还适用于::first-letter伪元素。 |
继承 | 无效 |
可动画的 | 是的。填充空间是有动画的。 |
版本 | CSS1 |
DOM 语法 | object.Style.PaddingBottom =“5%”; |
语法
padding-bottom: length | initial | inherit;
padding-bottom 属性示例:
<!DOCTYPE html> <html> <head> <title>文档的标题</title> <style> p { border: 2px solid #000; color: #1c87c9; padding-bottom: 40px; } </style> </head> <body> <h2>Padding-bottom 属性示例</h2> <p>经历过风雨,才懂得阳光的温暖。</p> </body> </html>
具有“长度”值的 padding-bottom 属性示例:
<!DOCTYPE html> <html> <head> <title>文档的标题</title> <style> p { border: 2px solid #000; color: #1c87c9; padding-bottom: 2cm; } </style> </head> <body> <h2>Padding-bottom 属性示例</h2> <p>经历过风雨,才懂得阳光的温暖。</p> </body> </html>
日期:2020-06-02 22:14:43 来源:oir作者:oir