सीएसएस पृष्ठभूमि आशुलिपि
सीएसएस पृष्ठभूमि - आशुलिपि संपत्ति
कोड को छोटा करने के लिए, एक ही संपत्ति में सभी पृष्ठभूमि गुणों को निर्दिष्ट करना भी संभव है। इसे शॉर्टहैंड प्रॉपर्टी कहा जाता है।
लिखने के बजाय:
body {
background-color: #ffffff;
background-image:
url("img_tree.png");
background-repeat: no-repeat;
background-position: right top;
}
आप आशुलिपि संपत्ति का उपयोग कर सकते हैं background
:
उदाहरण
एक घोषणा में पृष्ठभूमि गुण सेट करने के लिए आशुलिपि गुण का उपयोग करें:
body {
background: #ffffff url("img_tree.png") no-repeat right top;
}
आशुलिपि संपत्ति का उपयोग करते समय संपत्ति के मूल्यों का क्रम है:
background-color
background-image
background-repeat
background-attachment
background-position
इससे कोई फर्क नहीं पड़ता कि संपत्ति के मूल्यों में से एक गायब है, जब तक कि अन्य इस क्रम में हैं। ध्यान दें कि हम उपरोक्त उदाहरणों में पृष्ठभूमि-अनुलग्नक संपत्ति का उपयोग नहीं करते हैं, क्योंकि इसका कोई मूल्य नहीं है।
सभी सीएसएस पृष्ठभूमि गुण
Property | Description |
---|---|
background | Sets all the background properties in one declaration |
background-attachment | Sets whether a background image is fixed or scrolls with the rest of the page |
background-clip | Specifies the painting area of the background |
background-color | Sets the background color of an element |
background-image | Sets the background image for an element |
background-origin | Specifies where the background image(s) is/are positioned |
background-position | Sets the starting position of a background image |
background-repeat | Sets how a background image will be repeated |
background-size | Specifies the size of the background image(s) |