Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

<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: (a/b)/(c/d)

Your browser rendering: a b c d

<math>  
  <mfrac bevelled="true">
     <mfrac>
        <mi> a </mi>
        <mi> b </mi>
     </mfrac>
     <mfrac>
        <mi> c </mi>
        <mi> d </mi>
     </mfrac>
  </mfrac>
</math>

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

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support Not supported 1.0 (1.7 or earlier) Not supported Not supported 5.1
bevelled Not supported 1.0 (1.7 or earlier) Not supported Not supported Not supported
href Not supported 7.0 (7.0) Not supported Not supported Not supported
mathbackground Not supported 4.0 (2.0) Not supported Not supported 5.1
mathcolor Not supported 4.0 (2.0) Not supported Not supported 5.1
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support Not supported Not supported 1.0 (1.0) Not supported Not supported Not supported
bevelled Not supported Not supported 1.0 (1.0) Not supported Not supported Not supported
href Not supported Not supported 7.0 (7.0) Not supported Not supported Not supported
mathbackground Not supported Not supported 4.0 (2.0) Not supported Not supported Not supported
mathcolor Not supported Not supported 4.0 (2.0) Not supported Not supported Not supported

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.

文档标签和贡献者

 此页面的贡献者: fscholz, fred.wang, Sheppy, jswisher
 最后编辑者: fscholz,