सीएसएस पृष्ठभूमि-मूल संपत्ति
उदाहरण
पृष्ठभूमि-छवि सामग्री के ऊपरी बाएँ कोने से शुरू होने दें:
#example1 {
border: 10px dashed black;
padding:
25px;
background: url(paper.gif);
background-repeat: no-repeat;
background-origin:
content-box;
}
नीचे और अधिक "इसे स्वयं आज़माएं" उदाहरण।
परिभाषा और उपयोग
संपत्ति पृष्ठभूमि छवि की background-origin
मूल स्थिति (पृष्ठभूमि स्थिति क्षेत्र) निर्दिष्ट करती है।
नोट: यदि पृष्ठभूमि-अनुलग्नक "निश्चित" है तो इस संपत्ति का कोई प्रभाव नहीं पड़ता है।
डिफ़ॉल्ट मान: | गद्दी-बॉक्स |
---|---|
विरासत में मिला: | नहीं |
एनिमेटेबल: | नहीं। एनिमेटेबल के बारे में पढ़ें |
संस्करण: | CSS3 |
जावास्क्रिप्ट सिंटैक्स: | ऑब्जेक्ट .style.backgroundOrigin="content-box" |
ब्राउज़र समर्थन
तालिका में संख्याएं पहले ब्राउज़र संस्करण को निर्दिष्ट करती हैं जो पूरी तरह से संपत्ति का समर्थन करता है।
Property | |||||
---|---|---|---|---|---|
background-origin | 4.0 | 9.0 | 4.0 | 3.0 | 10.5 |
सीएसएस सिंटेक्स
background-origin: padding-box|border-box|content-box|initial|inherit;
सम्पत्ति की कीमत
Value | Description | Play it |
---|---|---|
padding-box | Default value. The background image starts from the upper left corner of the padding edge | |
border-box | The background image starts from the upper left corner of the border | |
content-box | The background image starts from the upper left corner of the content | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
और ज्यादा उदाहरण
उदाहरण
<div> तत्व के लिए दो पृष्ठभूमि चित्र सेट करें। चलो "paper.gif" पृष्ठभूमि छवि पैडिंग किनारे के ऊपरी बाएं कोने से शुरू होती है, और "img_tree.gif" पृष्ठभूमि छवि सामग्री के ऊपरी बाएं कोने से शुरू होती है:
#example1 {
border: 10px dashed black;
padding: 25px;
background: url(img_tree.gif), url(paper.gif);
background-repeat: no-repeat;
background-origin:
content-box, padding-box;
}
संबंधित पृष्ठ
सीएसएस ट्यूटोरियल: सीएसएस पृष्ठभूमि
एचटीएमएल डोम संदर्भ: पृष्ठभूमि मूल संपत्ति