Stil dolgusuBottom Özellik
Örnek
Bir <div> öğesinin alt dolgusunu ayarlayın:
document.getElementById("myDiv").style.paddingBottom = "50px";
Tanım ve Kullanım
paddingBottom özelliği, bir öğenin alt dolgusunu ayarlar veya döndürür.
Hem margin özelliği hem de padding özelliği, bir öğenin etrafına boşluk ekler. Ancak fark, kenar boşluğunun sınırın etrafındaki boşluğu eklemesi, dolgunun ise boşluğu bir öğenin sınırının içine eklemesidir.
Tarayıcı Desteği
Property | |||||
---|---|---|---|---|---|
paddingBottom | Yes | Yes | Yes | Yes | Yes |
Sözdizimi
paddingBottom özelliğini döndürün:
object.style.paddingBottom
paddingBottom özelliğini ayarlayın:
object.style.paddingBottom = "%|length|initial|inherit"
Mülk değerleri
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 |
Teknik detaylar
Varsayılan değer: | 0 |
---|---|
Geri dönüş değeri: | Bir elemanın alt dolgusunu temsil eden bir Dize |
CSS Sürümü | CSS1 |
Daha fazla örnek
Örnek
Bir <div> öğesinin alt dolgusunu "normal" olarak değiştirin:
document.getElementById("myDiv").style.paddingBottom = "0px";
Örnek
Bir <div> öğesinin alt dolgusunu döndürün:
alert(document.getElementById("myDiv").style.paddingBottom);
Örnek
marginBottom ve paddingBottom arasındaki fark:
function changeMargin() {
document.getElementById("myDiv").style.marginBottom = "100px";
}
function changePadding() {
document.getElementById("myDiv2").style.paddingBottom = "100px";
}
İlgili Sayfalar
CSS eğitimi: CSS Dolgusu
CSS referansı: dolgu-alt özelliği
HTML DOM referansı: dolgu özelliği
❮ Stil Nesnesi