शैली व्हाइटस्पेस संपत्ति
उदाहरण
निर्दिष्ट करें कि <div> तत्व में पाठ कभी भी लपेटा नहीं जाएगा:
document.getElementById("myDIV").style.whiteSpace = "nowrap";
परिभाषा और उपयोग
व्हाइटस्पेस प्रॉपर्टी टेक्स्ट में टैब, लाइन ब्रेक और व्हाइटस्पेस को कैसे हैंडल करती है, इसे सेट या रिटर्न करती है।
ब्राउज़र समर्थन
Property | |||||
---|---|---|---|---|---|
whiteSpace | Yes | Yes | Yes | Yes | Yes |
वाक्य - विन्यास
व्हाइटस्पेस संपत्ति लौटाएं:
object.style.whiteSpace
व्हाइटस्पेस संपत्ति सेट करें:
object.style.whiteSpace = "normal|nowrap|pre|initial|inherit"
सम्पत्ति की कीमत
Value | Description |
---|---|
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 |
टेक्निकल डिटेल
डिफ़ॉल्ट मान: | साधारण |
---|---|
प्रतिलाभ की मात्रा: | एक स्ट्रिंग, यह दर्शाती है कि किसी तत्व के अंदर सफेद-स्थान को कैसे संभाला जाता है |
सीएसएस संस्करण | सीएसएस 1 |
और ज्यादा उदाहरण
उदाहरण
व्हाइटस्पेस संपत्ति लौटाएं
alert(document.getElementById("myDiv").style.whiteSpace);
संबंधित पृष्ठ
सीएसएस ट्यूटोरियल: सीएसएस टेक्स्ट
सीएसएस संदर्भ: व्हाइट-स्पेस प्रॉपर्टी
❮ स्टाइल ऑब्जेक्ट