ပုံစံ နောက်ခံ ရာထူး ပိုင်ဆိုင်မှု
ဥပမာ
နောက်ခံပုံ၏ အနေအထားကို ပြောင်းပါ-
document.body.style.backgroundPosition = "top right";
အောက်တွင် နောက်ထပ် "စမ်းသုံးကြည့်ပါ" ဥပမာများ။
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
နောက်ခံအနေအထား ပိုင်ဆိုင်မှုသည် ဒြပ်စင်တစ်ခုအတွင်းရှိ နောက်ခံပုံ၏ အနေအထားကို သတ်မှတ် သို့မဟုတ် ပြန်ပေးသည်။
Browser ပံ့ပိုးမှု
ဇယားရှိ နံပါတ်များသည် ပိုင်ဆိုင်မှုကို အပြည့်အဝထောက်ခံသည့် ပထမဆုံးဘရောက်ဆာဗားရှင်းကို သတ်မှတ်ပေးသည်။
Property | |||||
---|---|---|---|---|---|
backgroundPosition | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
အထားအသို
နောက်ခံအနေအထား ပိုင်ဆိုင်မှုကို ပြန်ပေးပါ။
object.style.backgroundPosition
နောက်ခံအနေအထား ပိုင်ဆိုင်မှုကို သတ်မှတ်ပါ-
object.style.backgroundPosition = value
အိမ်ခြံမြေတန်ဖိုးများ
Value | Description |
---|---|
top left top center top right center left center center center right bottom left bottom center bottom right |
If you only specify one keyword, the other value will be "center". |
x% y% | The x value indicates the horizontal position and the y value indicates the vertical position. The top left corner is 0% 0%. The right bottom corner is 100% 100%. If you only specify one value, the other value will be 50%. |
xpos ypos | The x value indicates the horizontal position and the y value indicates the vertical position. The top left corner is 0 0. Units can be pixels (0px 0px) or any other CSS units. If you only specify one value, the other value will be 50%. You can mix % and units |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
နည်းပညာဆိုင်ရာအသေးစိတ်
မူလတန်ဖိုး: | ၀% ၀% |
---|---|
ပြန်ပို့တန်ဖိုး- | နောက်ခံပုံ၏ အနေအထားကို ကိုယ်စားပြုသော စာတန်း |
CSS ဗားရှင်း | CSS1 |
နောက်ထပ် ဥပမာများ
ဥပမာ
<div> ဒြပ်စင်ရှိ နောက်ခံပုံ၏ အနေအထားကို အောက်ခြေဗဟိုသို့ ပြောင်းပါ-
document.getElementById("myDiv").style.backgroundPosition = "center bottom";
ဥပမာ
<div> ဒြပ်စင်တစ်ခုရှိ နောက်ခံပုံ၏ အနေအထားကို 200px အလျားလိုက်နှင့် 40px ဒေါင်လိုက်သို့ ပြောင်းပါ-
document.getElementById("myDiv").style.backgroundPosition = "200px 40px";
ဥပမာ
<div> ဒြပ်စင်တစ်ခုတွင် နောက်ခံ-ပုံ၏ အနေအထားကို ပြန်ပေးပါ။
document.getElementById("myDiv").style.backgroundPosition;
ဆက်စပ်စာမျက်နှာများ
CSS သင်ခန်းစာ- CSS နောက်ခံ
CSS ရည်ညွှန်းချက်- နောက်ခံပုံ ပိုင်ဆိုင်မှု
CSS ရည်ညွှန်းချက်- နောက်ခံအနေအထား ပိုင်ဆိုင်မှု
HTML DOM ရည်ညွှန်းချက်- နောက်ခံပိုင်ဆိုင်မှု