paddingBottom 属性设置元素的下内边距。
padding 属性定义元素边框与元素内容之间的空间。
</>code
- Object.style.paddingBottom=length|%
值 | 描述 |
---|---|
length | 定义固定的下内边距值。默认值是 0。 |
% | 定义基于父元素高度的百分比下内边距。此值不会如预期的那样工作于所有的浏览器中。 |
下面的例子改变元素的下内边距:
</>code
- <html>
- <head>
- <style type="text/css">
- p
- {
- border: thin dotted #FF0000;
- }
- </style>
- <script type="text/javascript">
- function changePadding()
- {
document.getElementById("p1").style.paddingBottom="2cm";
- }
- </script>
- </head>
- <body>
- <input type="button" onclick="changePadding()"
- value="Change bottom padding" />
- <p id="p1">This is a paragraph</p>
- </body>
- </html>
如对本文有疑问,请提交到交流论坛,广大热心网友会为你解答!! 点击进入论坛
Powered by 365建站网 RSS地图 HTML地图
copyright © 2013-2024 版权所有 鄂ICP备17013400号