Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. MathML
  3. Reference
  4. Elements
  5. <mfrac>

<mfrac>

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨January 2023⁩.

The<mfrac>MathML element is used to display fractions. It can also be usedto mark up fraction-like objects such asbinomial coefficientsandLegendre symbols.

Syntax

html
<mfrac>numerator denominator</mfrac>

Attributes

This element's attributes include theglobal MathML attributes as well as the following attributes:

denomalignDeprecatedNon-standard

The alignment of the denominator under the fraction. Possible values are:left,center (default), andright.

linethickness

A<length-percentage> indicating the thickness of the horizontal fraction line.

numalignDeprecatedNon-standard

The alignment of the numerator over the fraction. Possible values are:left,center (default), andright.

Note:For thelinethickness attribute, some browsers may also accept the deprecated valuesmedium,thin andthick (whose exact interpretation is left to implementers) orlegacy MathML lengths.

Examples

Simple fraction

The following MathML code should render as a fraction with numerator "a + 2" anddenominator "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>

Fraction without bar

The following MathML code should render as abinomial coefficient:

html
<math display="block">  <mrow>    <mo>(</mo>    <mfrac linethickness="0">      <mi>n</mi>      <mi>k</mi>    </mfrac>    <mo>)</mo>  </mrow></math>

Technical summary

Implicit ARIA role None

Specifications

Specification
MathML Core
# fractions-mfrac

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp