Baseline 2023Newly available
Since January 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
The
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.
Syntax
numerator denominator
Attributes
This element's attributes include the global MathML attributes as well as the following attributes:
denomalign
Deprecated Non-standard-
The alignment of the denominator under the fraction. Possible values are:
left
,center
(default), andright
. linethickness
numalign
Deprecated Non-standard-
The alignment of the numerator over the fraction. Possible values are:
left
,center
(default), andright
.
Note:
For the linethickness
attribute, some browsers may also accept the deprecated values medium
, thin
and thick
(whose exact interpretation is left to implementers) or legacy MathML lengths.
Examples
Simple fraction
The following MathML code should render as a fraction with numerator "a + 2" and denominator "3 − b":
Fraction without bar
Technical summary
Implicit ARIA role | None |
---|
Specifications
Specification |
---|
MathML Core # fractions-mfrac |