ပုံစံ က whiteSpace ပိုင်ဆိုင်မှု
ဥပမာ
<div> ဒြပ်စင်ရှိ စာသားသည် ဘယ်တော့မှ ချုပ်မည်မဟုတ်ကြောင်း သတ်မှတ်ပါ-
document.getElementById("myDIV").style.whiteSpace = "nowrap";
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
whiteSpace ပိုင်ဆိုင်မှုသည် စာသားတစ်ခုတွင် တက်ဘ်များ၊ လိုင်းခွဲမှုများနှင့် နေရာလွတ်များကို ကိုင်တွယ်နည်းကို သတ်မှတ် သို့မဟုတ် ပြန်ပေးသည်။
Browser ပံ့ပိုးမှု
Property | |||||
---|---|---|---|---|---|
whiteSpace | Yes | Yes | Yes | Yes | Yes |
အထားအသို
whiteSpace ပိုင်ဆိုင်မှုကို ပြန်ပေးပါ-
object.style.whiteSpace
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 |
နည်းပညာဆိုင်ရာအသေးစိတ်
မူလတန်ဖိုး: | ပုံမှန် |
---|---|
ပြန်ပို့တန်ဖိုး- | ဒြပ်စင်တစ်ခုအတွင်း အဖြူရောင်နေရာကို ကိုင်တွယ်ပုံကို ကိုယ်စားပြုသည့် စာကြောင်းတစ်ခု |
CSS ဗားရှင်း | CSS1 |
နောက်ထပ် ဥပမာများ
ဥပမာ
whiteSpace ပိုင်ဆိုင်မှုကို ပြန်ပေးပါ။
alert(document.getElementById("myDiv").style.whiteSpace);
ဆက်စပ်စာမျက်နှာများ
CSS သင်ခန်းစာ- CSS စာသား
CSS ရည်ညွှန်းချက်- နေရာလွတ် ပိုင်ဆိုင်မှု
❮ စတိုင်အရာဝတ္ထု