सीएसएस सामग्री संपत्ति
उदाहरण
निम्न उदाहरण प्रत्येक <a> तत्व के बाद कोष्ठक में href विशेषता का मान सम्मिलित करता है:
a::after {
content: " (" attr(href) ")";
}
नीचे और अधिक "इसे स्वयं आज़माएं" उदाहरण।
परिभाषा और उपयोग
content
संपत्ति का उपयोग
:: पहले और :: छद्म तत्वों के बाद, उत्पन्न सामग्री को सम्मिलित करने के लिए किया जाता है।
डिफ़ॉल्ट मान: | साधारण |
---|---|
विरासत में मिला: | नहीं |
एनिमेटेबल: | नहीं। एनिमेटेबल के बारे में पढ़ें |
संस्करण: | सीएसएस 2 |
जावास्क्रिप्ट सिंटैक्स: | आप जावास्क्रिप्ट का उपयोग करके किसी तत्व को छद्म वर्ग नहीं दे सकते हैं, लेकिन समान परिणाम प्राप्त करने के अन्य तरीके भी हैं: |
ब्राउज़र समर्थन
तालिका में संख्याएं पहले ब्राउज़र संस्करण को निर्दिष्ट करती हैं जो पूरी तरह से संपत्ति का समर्थन करता है।
Property | |||||
---|---|---|---|---|---|
content | 1.0 | 8.0 | 1.0 | 1.0 | 4.0 |
सीएसएस सिंटेक्स
content: normal|none|counter|attr|string|open-quote|close-quote|no-open-quote|no-close-quote|url|initial|inherit;
सम्पत्ति की कीमत
Value | Description | Example |
---|---|---|
normal | Default value. Sets the content, if specified, to normal, which default is "none" (which is nothing) | |
none | Sets the content, if specified, to nothing | |
counter | Sets the content as a counter | |
attr(attribute) | Sets the content as one of the selector's attribute | |
string | Sets the content to the text you specify | |
open-quote | Sets the content to be an opening quote | |
close-quote | Sets the content to be a closing quote | |
no-open-quote | Removes the opening quote from the content, if specified | |
no-close-quote | Removes the closing quote from the content, if specified | |
url(url) | Sets the content to be some kind of media (an image, a sound, a video, etc.) | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
और ज्यादा उदाहरण
उदाहरण
<ul> या <ol> के लिए उनके डिफ़ॉल्ट बुलेट को हटाकर और बुलेट की तरह दिखने वाली HTML इकाई को जोड़कर बुलेट रंग कैसे जोड़ें (•):
ul {
list-style: none; /* Remove HTML bullets */
padding: 0;
margin: 0;
}
li {
padding-left: 16px;
}
li::before {
content: "•"; /* Insert content that looks like bullets */
padding-right: 8px;
color: blue; /* Or a color you prefer */
}
संबंधित पृष्ठ
CSS संदर्भ: :: छद्म तत्व से पहले
सीएसएस संदर्भ: :: छद्म तत्व के बाद