सीएसएस व्हाइट-स्पेस प्रॉपर्टी
उदाहरण
व्हाइट-स्पेस प्रॉपर्टी के विभिन्न मूल्यों को प्रदर्शित करें:
p.a {
white-space: nowrap;
}
p.b {
white-space: normal;
}
p.c {
white-space:
pre;
}
परिभाषा और उपयोग
संपत्ति निर्दिष्ट करती है कि white-space
किसी तत्व के अंदर सफेद-स्थान कैसे संभाला जाता है।
डिफ़ॉल्ट मान: | साधारण |
---|---|
विरासत में मिला: | हां |
एनिमेटेबल: | नहीं। एनिमेटेबल के बारे में पढ़ें |
संस्करण: | सीएसएस 1 |
जावास्क्रिप्ट सिंटैक्स: | ऑब्जेक्ट .style.whiteSpace="nowrap" |
ब्राउज़र समर्थन
तालिका में संख्याएं पहले ब्राउज़र संस्करण को निर्दिष्ट करती हैं जो पूरी तरह से संपत्ति का समर्थन करता है।
Property | |||||
---|---|---|---|---|---|
white-space | 1.0 | 8.0 | 3.5 | 3.0 | 9.5 |
सीएसएस सिंटेक्स
white-space: normal|nowrap|pre|pre-line|pre-wrap|initial|inherit;
सम्पत्ति की कीमत
Value | Description | Play it |
---|---|---|
normal | Sequences of whitespace will collapse into a single whitespace. Text will wrap when necessary. This is default | |
nowrap | Sequences of whitespace will collapse into a single whitespace. Text will never wrap to the next line. The text continues on the same line until a <br> tag is encountered | |
pre | Whitespace is preserved by the browser. Text will only wrap on line breaks. Acts like the <pre> tag in HTML | |
pre-line | Sequences of whitespace will collapse into a single whitespace. Text will wrap when necessary, and on line breaks | |
pre-wrap | Whitespace is preserved by the browser. Text will wrap when necessary, and on line breaks | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
संबंधित पृष्ठ
सीएसएस ट्यूटोरियल: सीएसएस टेक्स्ट
एचटीएमएल डोम संदर्भ: व्हाइटस्पेस संपत्ति