CKTIS / CSS
CSS-Eigenschaft `math-shift`
`math-shift` wählt normale oder kompakte Indexverschiebung in MathML.
Version: CSS modules; captured CSSWG editor index includes draft and obsolete features requiring review
Syntax
normal | compactmath-shift wählt normale oder kompakte Indexverschiebung in MathML.
Das Beispiel vergleicht die Hochstellung in beiden Modi und meldet den berechneten Wert am msup-Element.
Die akzeptierte Grammatik ist normal | compact; globale Werte nehmen weiterhin an der Kaskade teil.
Der Unterschied hängt von Mathematikkonstanten der Schrift ab; die Geometrie kann trotz compact gleich bleiben.
Beispiele
<!doctype html>
<html lang="en"><meta charset="utf-8"><title>CKTIS CSS reference example</title>
<body><div class="probe">probe</div><pre id="result"></pre><script>
document.body.innerHTML='<math><msup id="x"><mi id="b">V</mi><mi id="s">x</mi></msup></math><pre id="result"></pre>';const x=document.querySelector("#x"),b=document.querySelector("#b"),s=document.querySelector("#s");x.style.mathStyle="compact";x.style.mathShift="normal";const a=Math.round(s.getBoundingClientRect().top-b.getBoundingClientRect().top);x.style.mathShift="compact";const z=Math.round(s.getBoundingClientRect().top-b.getBoundingClientRect().top);document.querySelector("#result").textContent="script-y="+a+"->"+z+"; computed="+getComputedStyle(x).mathShift;
</script></body></html>Ergebnis
script-y=-2->-2; computed=compact
Das Beispiel lief lokal in einer isolierten Chrome-Sitzung ohne Netzwerk; das Ergebnis stammt aus der CSS-API des Browsers.