ပုံစံ objectPosition Property
ဥပမာ
ပုံတစ်ပုံကို ၎င်း၏အကြောင်းအရာအကွက်နှင့် အံဝင်ခွင်ကျဖြစ်အောင် အရွယ်အစားပြောင်းပြီး ပုံအား ဘယ်ဘက်မှ 5px နှင့် အကြောင်းအရာဘောက်စ်အတွင်း ထိပ်မှ 10% ကို နေရာချထားပါ-
document.getElementById("myImg").style.objectPosition = "0 10%";
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
<img> သို့မဟုတ် <video> ကို ၎င်း၏ကိုယ်ပိုင်အကြောင်းအရာအကွက်တွင် မည်သို့နေရာချထားသင့်သည်ကို သတ်မှတ်ရန် objectPosition ပိုင်ဆိုင်မှုကို အသုံးပြုသည်။
Browser ပံ့ပိုးမှု
ဇယားရှိ နံပါတ်များသည် ပိုင်ဆိုင်မှုကို အပြည့်အဝထောက်ခံသည့် ပထမဆုံးဘရောက်ဆာဗားရှင်းကို သတ်မှတ်ပေးသည်။
Property | |||||
---|---|---|---|---|---|
objectPosition | 31.0 | 16.0 | 36.0 | 10.1 | 19.0 |
အထားအသို
ObjectPosition ပိုင်ဆိုင်မှုကို ပြန်ပေးပါ။
object.style.objectPosition
ObjectPosition ပိုင်ဆိုင်မှုကို သတ်မှတ်ပါ-
object.style.objectPosition = "position|initial|inherit"
အိမ်ခြံမြေတန်ဖိုးများ
Value | Description |
---|---|
position | Specifies the position of the image or video inside its content box. First value controls the x-asis and the second value controls the y-axis. Can be a string (left, center or right), or a number (in px or %). Negative values are allowed |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
နည်းပညာဆိုင်ရာအသေးစိတ်
မူလတန်ဖိုး: | 50% 50% |
---|---|
ပြန်ပို့တန်ဖိုး- | ၎င်း၏အကြောင်းအရာအကွက်ရှိ ဒြပ်စင်တစ်ခု၏ အနေအထားကို ကိုယ်စားပြုသည့် စာတန်း သို့မဟုတ် နံပါတ်တစ်ခု |
CSS ဗားရှင်း | CSS3 |
ဆက်စပ်စာမျက်နှာများ
CSS သင်ခန်းစာ- CSS object-fit
CSS ရည်ညွှန်းချက်- အရာဝတ္ထု-တည်နေရာပိုင်ဆိုင်မှု
❮ စတိုင်အရာဝတ္ထု