सीएसएस मार्जिन-बाएं संपत्ति
उदाहरण
<p> तत्व के लिए बाएँ हाशिया को 30 पिक्सेल पर सेट करें:
p.ex1 {
margin-left: 30px;
}
नीचे और अधिक "इसे स्वयं आज़माएं" उदाहरण।
परिभाषा और उपयोग
margin-left
गुण किसी तत्व के बाएँ हाशिया को सेट करता है ।
नोट: नकारात्मक मानों की अनुमति है।
डिफ़ॉल्ट मान: | 0 |
---|---|
विरासत में मिला: | नहीं |
एनिमेटेबल: | हाँ, व्यक्तिगत गुण देखें । एनिमेटेबल के बारे में पढ़ें |
संस्करण: | सीएसएस 1 |
जावास्क्रिप्ट सिंटैक्स: | ऑब्जेक्ट .style.marginLeft="100px" |
ब्राउज़र समर्थन
तालिका में संख्याएं पहले ब्राउज़र संस्करण को निर्दिष्ट करती हैं जो पूरी तरह से संपत्ति का समर्थन करता है।
Property | |||||
---|---|---|---|---|---|
margin-left | 1.0 | 6.0 | 1.0 | 1.0 | 3.5 |
सीएसएस सिंटेक्स
margin-left: length|auto|initial|inherit;
सम्पत्ति की कीमत
Value | Description | Play it |
---|---|---|
length | Specifies a fixed left margin in px, pt, cm, etc. Default value is 0px. Negative values are allowed. Read about length units | |
% | Specifies a left margin in percent of the width of the containing element | |
auto | The browser calculates a left margin | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
और ज्यादा उदाहरण
उदाहरण
<p> तत्व के बाएँ हाशिया को कंटेनर की चौड़ाई के 10% पर सेट करें:
p.ex1 {
margin-left: 10%;
}
उदाहरण
<p> तत्व के लिए बाएं हाशिये को 2 em पर सेट करें:
p.ex1 {
margin-left: 2em;
}
संबंधित पृष्ठ
सीएसएस ट्यूटोरियल: सीएसएस मार्जिन
एचटीएमएल डोम संदर्भ: मार्जिन लेफ्ट संपत्ति