files/en-us/web/mathml/reference/element/mfrac/index.md
The <mfrac> MathML element is used to display fractions. It can also be used
to mark up fraction-like objects such as
binomial coefficients
and Legendre symbols.
<mfrac>numerator denominator</mfrac>
This element's attributes include the global MathML attributes as well as the following attributes:
denomalign {{deprecated_inline}} {{Non-standard_Inline}}
left, center (default), and right.linethickness
numalign {{deprecated_inline}} {{Non-standard_Inline}}
left, center (default), and right.[!NOTE] For the
linethicknessattribute, some browsers may also accept the deprecated valuesmedium,thinandthick(whose exact interpretation is left to implementers) or legacy MathML lengths.
The following MathML code should render as a fraction with numerator "a + 2" and denominator "3 − b":
<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>
{{ EmbedLiveSample('simple_fraction', 700, 200, "", "") }}
The following MathML code should render as a binomial coefficient:
<math display="block">
<mrow>
<mo>(</mo>
<mfrac linethickness="0">
<mi>n</mi>
<mi>k</mi>
</mfrac>
<mo>)</mo>
</mrow>
</math>
{{ EmbedLiveSample('Fraction_without_bar', 700, 200, "", "") }}
{{Specifications}}
{{Compat}}