CKTIS / CSS
Lastnost CSS `left`
`left` nastavi fizični odmik levega roba pozicioniranega polja od vsebovalnega bloka.
Različica: CSS modules; captured CSSWG editor index includes draft and obsolete features requiring review
Sintaksa
auto | <length-percentage> | <anchor()> | <anchor-size()>left nastavi fizični odmik levega roba pozicioniranega polja od vsebovalnega bloka.
Primer primerja x absolutnega otroka pred in po left:12px.
Slovnica: auto | <length-percentage> | <anchor()> | <anchor-size()>.
Na position:static ne deluje in je fizična; za smer uporabite inset-inline-start. Preveč določene left/right/width rešijo pravila sporov.
Primeri
<!doctype html><html lang="en"><meta charset="utf-8"><title>CKTIS CSS example</title><body><pre id="result"></pre><script>const g=document.createElement("div"),x=document.createElement("i");document.body.prepend(g);g.append(x);g.style.cssText="position:relative;width:100px;height:40px";x.style.cssText="position:absolute;width:20px;height:10px";const a=g.getBoundingClientRect(),x0=Math.round(x.getBoundingClientRect().left-a.left);x.style.left="12px";const x1=Math.round(x.getBoundingClientRect().left-a.left);document.querySelector("#result").textContent="child-x="+x0+"->"+x1+"; computed="+getComputedStyle(x).left;</script></body></html>Rezultat
child-x=0->12; computed=12px
Primer je bil izveden lokalno v izolirani seji Chrome brez omrežja; rezultat prihaja iz brskalnikovega API CSS.