Styl opvullingBottom Eiendom
Voorbeeld
Stel die onderste vulling van 'n <div>-element:
document.getElementById("myDiv").style.paddingBottom = "50px";
Definisie en gebruik
Die paddingBottom-eienskap stel of gee die onderste vulling van 'n element terug.
Beide die marge-eienskap en die padding-eienskap voeg spasie om 'n element in. Die verskil is egter dat marge die spasie om die grens invoeg, terwyl opvulling die spasie binne die grens van 'n element invoeg.
Blaaierondersteuning
Property | |||||
---|---|---|---|---|---|
paddingBottom | Yes | Yes | Yes | Yes | Yes |
Sintaksis
Gee die paddingBottom-eienskap terug:
object.style.paddingBottom
Stel die paddingBottom-eienskap:
object.style.paddingBottom = "%|length|initial|inherit"
Eiendomswaardes
Value | Description |
---|---|
% | Defines the bottom padding in % of the width of the parent element |
length | Defines the bottom padding in length units |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Tegniese besonderhede
Standaard waarde: | 0 |
---|---|
Terugkeerwaarde: | 'n String, wat die onderste vulling van 'n element voorstel |
CSS weergawe | CSS1 |
Meer voorbeelde
Voorbeeld
Verander die onderste vulling van 'n <div> element terug na "normaal":
document.getElementById("myDiv").style.paddingBottom = "0px";
Voorbeeld
Gee die onderste vulling van 'n <div>-element terug:
alert(document.getElementById("myDiv").style.paddingBottom);
Voorbeeld
Verskil tussen marginBottom en paddingBottom:
function changeMargin() {
document.getElementById("myDiv").style.marginBottom = "100px";
}
function changePadding() {
document.getElementById("myDiv2").style.paddingBottom = "100px";
}
Verwante bladsye
CSS handleiding: CSS Padding
CSS verwysing: padding-bottom eiendom
HTML DOM verwysing: opvulling eiendom
❮ Stylvoorwerp