The MathML <mn>
element represents a numeric literal which is normally a sequence of digits with a possible separator (a dot or a comma). However, it is also allowed to have arbitrary text in it which is actually a numeric quantity, for example "eleven".
Attributes
- class, id, style
- Provided for use with stylesheets.
- dir
- The text direction. Possible values are either
ltr
(left to right) orrtl
(right to left). - href
- Used to set a hyperlink to a specified URI.
- mathbackground
- The background color. You can use
#rgb
,#rrggbb
and HTML color names. - mathcolor
- The text color. You can use
#rgb
,#rrggbb
and HTML color names. - mathsize
- The size of the content. See length for possible values.
Deprecated values are:small
,normal
andbig
. These will be removed in the future. - mathvariant
- This attribute specifies the logical class of the number which varies in typography. That is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. The following values are allowed:
normal
(Default value) ;bold
;italic
;bold-italic
;
double-struck
;bold-fraktur
;script
;bold-script
;fraktur
;
sans-serif
;bold-sans-serif
;sans-serif-italic
;sans-serif-bold-italic
;monospace
;
initial
;tailed
;looped
;stretched
;
Examples
<math> <mn> 0 </mn> <mn> 1.337 </mn> <mn> twelve </mn> <mn> XVI </mn> <mn> 2e10 </mn> </math>
Specifications
Specification | Status | Comment |
---|---|---|
MathML 3.0 The definition of 'mn' in that specification. |
Recommendation | Current specification |
MathML 2.0 The definition of 'mn' in that specification. |
Recommendation | Initial specification |
Browser compatibility
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
mn | Chrome No support No | Edge No support No | Firefox Full support 1 | IE No support No | Opera No support No | Safari Full support 6 | WebView Android No support No | Chrome Android No support No | Firefox Android Full support 4 | Opera Android No support No | Safari iOS No support No | Samsung Internet Android No support No |
dir | Chrome No support No | Edge No support No | Firefox Full support 12 | IE No support No | Opera No support No | Safari No support No | WebView Android No support No | Chrome Android No support No | Firefox Android Full support 14 | Opera Android No support No | Safari iOS No support No | Samsung Internet Android No support No |
href | Chrome No support No | Edge No support No | Firefox Full support 7 | IE No support No | Opera No support No | Safari No support No | WebView Android No support No | Chrome Android No support No | Firefox Android Full support 7 | Opera Android No support No | Safari iOS No support No | Samsung Internet Android No support No |
mathsize | Chrome No support No | Edge No support No | Firefox Full support 1 | IE No support No | Opera No support No | Safari Full support 6 | WebView Android No support No | Chrome Android No support No | Firefox Android Full support 4 | Opera Android No support No | Safari iOS No support No | Samsung Internet Android No support No |
mathvariant | Chrome No support No | Edge No support No | Firefox Full support 28 | IE No support No | Opera No support No | Safari No support No | WebView Android No support No | Chrome Android No support No | Firefox Android Full support 28 | Opera Android No support No | Safari iOS No support No | Samsung Internet Android No support No |
Legend
- Full support
- Full support
- No support
- No support
Gecko-specific notes
- Some
mathvariant
values are only implemented starting with Gecko 28.0 (Firefox 28.0 / Thunderbird 28.0 / SeaMonkey 2.25) and require appropriate math fonts.