स्टाइल मार्जिनबॉटम प्रॉपर्टी
उदाहरण
<div> तत्व का निचला मार्जिन सेट करें:
document.getElementById("myDiv").style.marginBottom = "50px";
परिभाषा और उपयोग
मार्जिनबॉटम संपत्ति किसी तत्व के निचले मार्जिन को सेट या लौटाती है।
मार्जिन प्रॉपर्टी और पैडिंग प्रॉपर्टी दोनों एक तत्व के चारों ओर जगह डालते हैं। हालांकि, अंतर यह है कि मार्जिन सीमा के आसपास के स्थान को सम्मिलित करता है, जबकि पैडिंग किसी तत्व की सीमा के भीतर स्थान सम्मिलित करता है।
ब्राउज़र समर्थन
Property | |||||
---|---|---|---|---|---|
marginBottom | Yes | Yes | Yes | Yes | Yes |
वाक्य - विन्यास
मार्जिनबॉटम संपत्ति लौटाएं:
object.style.marginBottom
मार्जिनबॉटम प्रॉपर्टी सेट करें:
object.style.marginBottom = "%|length|auto|initial|inherit"
सम्पत्ति की कीमत
Value | Description |
---|---|
% | Defines the bottom margin in % of the width of the parent element |
length | Defines the bottom margin in length units |
auto | The browser sets the bottom margin |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
टेक्निकल डिटेल
डिफ़ॉल्ट मान: | 0 |
---|---|
प्रतिलाभ की मात्रा: | एक स्ट्रिंग, एक तत्व के निचले मार्जिन का प्रतिनिधित्व करता है |
सीएसएस संस्करण | सीएसएस 1 |
और ज्यादा उदाहरण
उदाहरण
<div> तत्व के निचले मार्जिन को वापस "सामान्य" में बदलें:
document.getElementById("myDiv").style.marginBottom = "0px";
उदाहरण
<div> तत्व का निचला हाशिया लौटाएं:
alert(document.getElementById("myDiv").style.marginBottom);
उदाहरण
मार्जिनबॉटम और पैडिंगबॉटम के बीच अंतर:
function changeMargin() {
document.getElementById("myDiv").style.marginBottom = "100px";
}
function changePadding() {
document.getElementById("myDiv2").style.paddingBottom = "100px";
}
संबंधित पृष्ठ
सीएसएस ट्यूटोरियल: सीएसएस मार्जिन
CSS संदर्भ: मार्जिन-निचला गुण
एचटीएमएल डोम संदर्भ: मार्जिन संपत्ति
❮ स्टाइल ऑब्जेक्ट