Style paddingBottom egenskap
- Föregående sida padding
- Nästa sida paddingLeft
- Gå tillbaka till föregående nivå HTML DOM Style Object
Definition and usage
paddingBottom
Sets or returns the bottom inner padding of the element.
margin property and padding property They all insert space around the element. However, the difference is that margin inserts space around the border, while padding inserts space inside the element's border.
See also:
CSS Tutorial:CSS inre marginalia
CSS Reference Manual:padding-bottom property
HTML DOM Reference Manual:padding property
Instance
Example 1
Set the bottom inner padding of the <div> element:
document.getElementById("myDiv").style.paddingBottom = "50px";
Example 2
Change the bottom inner padding of the <div> element back to "normal":
document.getElementById("myDiv").style.paddingBottom = "0px";
Example 3
Return the bottom inner padding of the <div> element:
alert(document.getElementById("myDiv").style.paddingBottom);
Example 4
Difference between marginBottom and paddingBottom:
function changeMargin() { document.getElementById("myDiv").style.marginBottom = "100px"; } function changePadding() { document.getElementById("myDiv2").style.paddingBottom = "100px"; }
Syntax
Return the paddingBottom property:
object.style.paddingBottom
Set the paddingBottom property:
object.style.paddingBottom = "%|length|initial|inherit"
Attribute value
Value | Description |
---|---|
% | Define the bottom inner padding as a percentage of the parent element's width. |
length | Define the bottom inner padding with a length unit. |
initial | Sets this property to its default value. See initial. |
inherit | Inherits this property from its parent element. See inherit. |
Technical details
Default value: | 0 |
---|---|
Return value: | A string that represents the bottom inner padding of an element. |
CSS version: | CSS1 |
Webbläsarstöd
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Stöd | Stöd | Stöd | Stöd | Stöd |
- Föregående sida padding
- Nästa sida paddingLeft
- Gå tillbaka till föregående nivå HTML DOM Style Object