Dieser Inhalt wurde automatisch aus dem Englischen übersetzt, und kann Fehler enthalten. Erfahre mehr über dieses Experiment.

View in English Always switch to English

math-style

Baseline Weitgehend verfügbar

Diese Funktion ist gut etabliert und funktioniert auf vielen Geräten und in vielen Browserversionen. Sie ist seit August 2023 browserübergreifend verfügbar.

Die math-style-Eigenschaft gibt an, ob MathML-Gleichungen mit normaler oder kompakter Höhe gerendert werden sollen.

Syntax

css
/* Keyword values */
math-style: normal;
math-style: compact;

/* Global values */
math-style: inherit;
math-style: initial;
math-style: revert;
math-style: revert-layer;
math-style: unset;

Werte

normal

Der Anfangswert, zeigt normales Rendering an.

compact

Das mathematische Layout bei Nachfahren versucht, die logische Höhe zu minimieren.

Formale Definition

Anfangswertnormal
Anwendbar aufalle Elemente
VererbtJa
Berechneter Wertwie angegeben
AnimationstypNot animatable

Formale Syntax

math-style = 
normal |
compact
Diese Syntax spiegelt den neuesten Standard gemäß MathML Core wider. Möglicherweise haben nicht alle Browser jeden Teil implementiert. Siehe Browserkompatibilität für Informationen zur Unterstützung.

Beispiele

Ändern des Stils einer Formel zu kompakt

CSS

css
math {
  math-style: normal;
}
.compact {
  math-style: compact;
}

HTML

html
<p>
  Normal height
  <math>
    <mrow>
      <munderover>
        <mo>∑</mo>
        <mrow>
          <mi>n</mi>
          <mo>=</mo>
          <mn>1</mn>
        </mrow>
        <mrow>
          <mo>+</mo>
          <mn>∞</mn>
        </mrow>
      </munderover>
    </mrow>
  </math>
  and compact height
  <math class="compact">
    <mrow>
      <munderover>
        <mo>∑</mo>
        <mrow>
          <mi>n</mi>
          <mo>=</mo>
          <mn>1</mn>
        </mrow>
        <mrow>
          <mo>+</mo>
          <mn>∞</mn>
        </mrow>
      </munderover>
    </mrow>
  </math>
  equations.
</p>

Ergebnis

Spezifikationen

Spezifikation
MathML Core
# the-math-style-property

Browser-Kompatibilität

Siehe auch