# <mfrac>

The MathML `<mfrac>` element is used to display fractions.

## Syntax

`<mfrac>numerator denominator</mfrac>`

## Attributes

bevelled
Specifies the way the fraction is displayed. If `true`, the fraction line is bevelled, which means that numerator and denominator are displayed side by side and separated by a slash (/). Otherwise, if set to `false` (which is the default value), numerator and denominator are on top of each other.
class, id, style
Provided for use with stylesheets.
denomalign
The alignment of the denominator under the fraction. Possible values are: `left`, `center` (default), and `right`.
href
Used to set a hyperlink to a specified URI.
linethickness
The thickness of the horizontal fraction line. The default value is `medium`, but `thin`, `thick`, and other length values can be set.
mathbackground
The background color. You can use `#rgb`, `#rrggbb` and HTML color names.
mathcolor
The text color and also the fraction line color. You can use `#rgb`, `#rrggbb` and HTML color names.
numalign
The alignment of the numerator over the fraction. Possible values are: `left`, `center` (default), and `right`.

## Examples

Sample rendering:

Your browser rendering: $\frac{a}{b}}{\frac{c}{d}}$

```[itex]
<mfrac bevelled="true">
<mfrac>
<mi> a </mi>
<mi> b </mi>
</mfrac>
<mfrac>
<mi> c </mi>
<mi> d </mi>
</mfrac>
</mfrac>
[/itex]
```

## Specifications

Specification Status Comment
MathML 3.0
The definition of 'mfrac' in that specification.
Recommendation Current specification
MathML 2.0
The definition of 'mfrac' in that specification.
Recommendation Initial specification

## Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support No ?1 No No6
`bevelled` No ?1 No No No
`href` No ?7 No No10
`mathbackground` No ?4 No No6
`mathcolor` No ?4 No No6
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support No No ?4 No Yes ?
`bevelled` No No ?4 No No ?
`href` No No ?7 No No ?
`mathbackground` No No ?4 No No ?
`mathcolor` No No ?4 No No ?

## Gecko-specific notes

• Starting with Gecko 7.0 (Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4) the `medium` value for the `linethickness` attribute has been corrected to match the default thickness.

Tags: