<mfrac>
語法
html
<mfrac>numerator denominator</mfrac>
屬性
該元素的屬性包括 全域性 MathML 屬性 以及以下屬性:
denomalign已棄用 非標準-
分母在分數下的對齊方式。可能的值為:
left(左對齊)、center(居中,預設)和right(右對齊)。 linethickness-
一個
<length-percentage>,用於指示分數橫線的粗細。 numalign已棄用 非標準-
分子在分數上的對齊方式。可能的值為:
left(左對齊)、center(居中,預設)和right(右對齊)。
注意: 對於 linethickness 屬性,某些瀏覽器也可能接受已棄用的值 medium、thin 和 thick(其確切解釋留給實現者)或 舊版 MathML 長度。
示例
簡單分數
以下 MathML 程式碼應渲染為分子為“a + 2”,分母為“3 − b”的分數。
html
<math display="block">
<mfrac>
<mrow>
<mi>a</mi>
<mo>+</mo>
<mn>2</mn>
</mrow>
<mrow>
<mn>3</mn>
<mo>−</mo>
<mi>b</mi>
</mrow>
</mfrac>
</math>
無橫線的分數
以下 MathML 程式碼應渲染為 二項式係數。
html
<math display="block">
<mrow>
<mo>(</mo>
<mfrac linethickness="0">
<mi>n</mi>
<mi>k</mi>
</mfrac>
<mo>)</mo>
</mrow>
</math>
技術摘要
| 隱式 ARIA 角色 | None |
|---|
規範
| 規範 |
|---|
| MathML Core # fractions-mfrac |
瀏覽器相容性
載入中…