စတိုင်လ် အိမ်ခြံမြေ _
ဥပမာ
<button> အစိတ်အပိုင်းတစ်ခု၏ ဘယ်ဘက်အနေအထားကို သတ်မှတ်ပါ-
document.getElementById("myBtn").style.left = "100px";
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
ဘယ်ဘက်ပိုင်ဆိုင်မှုသည် နေရာချထားသော ဒြပ်စင်တစ်ခု၏ ဘယ်ဘက်အနေအထားကို သတ်မှတ်ပေးသည် သို့မဟုတ် ပြန်ပေးသည်။
ဤပိုင်ဆိုင်မှုသည် padding၊ scrollbar၊ border နှင့် margin အပါအဝင် element ၏ ဘယ်ဘက်အနေအထားကို သတ်မှတ်ပေးသည်။
အကြံပြုချက်- နေရာချထားသောဒြပ်စင်သည် ဆွေမျိုး၊ အကြွင်းမဲ့ သို့မဟုတ် ပုံသေသတ်မှတ်ထားသည့် အနေအထားပိုင်ဆိုင်မှုပါရှိသော ဒြပ်စင်တစ်ခုဖြစ်သည်။
အကြံပြုချက်- နေရာချထားသော ဒြပ်စင်တစ်ခု၏ မှန်ကန်သော အနေအထားကို သတ်မှတ်ရန် သို့မဟုတ် ပြန်ပေးရန်၊ မှန်ကန်သော ပိုင်ဆိုင်မှုကို အသုံးပြုပါ။
Browser ပံ့ပိုးမှု
Property | |||||
---|---|---|---|---|---|
left | Yes | Yes | Yes | Yes | Yes |
အထားအသို
ဘယ်ဘက်ပိုင်ဆိုင်မှုကို ပြန်ပေးပါ-
object.style.left
ဘယ်ဘက်ပိုင်ဆိုင်မှုကို သတ်မှတ်ပါ-
object.style.left = "auto|length|%|initial|inherit"
အိမ်ခြံမြေတန်ဖိုးများ
Value | Description |
---|---|
auto | Lets the browser set the left position. This is default |
length | Defines the left position in length units. Negative values are allowed |
% | Sets the left position in % of the width of the parent element |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
နည်းပညာဆိုင်ရာအသေးစိတ်
မူလတန်ဖိုး: | အော်တို |
---|---|
ပြန်ပို့တန်ဖိုး- | နေရာချထားသော ဒြပ်စင်တစ်ခု၏ ဘယ်ဘက် အနေအထားကို ကိုယ်စားပြုသော စာတန်း |
CSS ဗားရှင်း | CSS2 |
နောက်ထပ် ဥပမာများ
ဥပမာ
<div> ဒြပ်စင်တစ်ခု၏ ဘယ်ဘက်အနေအထားကို သတ်မှတ်ပါ-
document.getElementById("myDIV").style.left = "100px";
ဥပမာ
အနုတ်လက္ခဏာတန်ဖိုးများကို အသုံးပြုခြင်း - <div> ဒြပ်စင်တစ်ခု၏ ဘယ်ဘက်အနေအထားကို သတ်မှတ်ပါ-
document.getElementById("myDIV").style.left = "-100px";
ဥပမာ
<div> ဒြပ်စင်တစ်ခု၏ ဘယ်ဘက်အနေအထားကို ပြန်ပေးပါ။
alert(document.getElementById("myDiv").style.left);
ဆက်စပ်စာမျက်နှာများ
CSS သင်ခန်းစာ- CSS နေရာချထား ခြင်း။
CSS ရည်ညွှန်းချက်- ဘယ်ဘက်ပိုင်ဆိုင်မှု
❮ စတိုင်အရာဝတ္ထု