The MathML <ms> element represents a string literal meant to be interpreted by programming languages and computer algebra systems. By default, string literals are displayed as enclosed by double quotes (&quot;); by using the lquote and rquote attributes, you can set custom characters to display. Note that quotation marks should not be specified unless they are part of the string literal. The content of an <ms> element is not an ASCII string per se, but rather a sequence of characters and <mglyph> and <malignmark> elements.

Attributes

class, id, style
Provided for use with stylesheets.
dir
The text direction. Possible values are either ltr (left to right) or rtl (right to left).
lquote
The opening quote character (depends on dir) to enclose the content. The default value is "&quot;".
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. Possible values are:
  • small: Font is rendered smaller than the current font size.
  • normal:Equivalent to 100% or 1em.
  • big: Font is rendered larger than the current font size.
  • a custom length.
  • or a unitless value which multiplies the default.
mathvariant
This attribute specifies the logical class of the identifier, 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) ; Example
  • bold ; Example
  • italic ; Example
  • bold-italic ; Example
  • double-struck ; Example
  • bold-fraktur ; Example
  • script ; Example
  • bold-script ; Example
  • fraktur ; Example
  • sans-serif ; Example
  • bold-sans-serif ; Example
  • sans-serif-italic ; Example
  • sans-serif-bold-italic ; Example
  • monospace ; Example
  • initial ; مثال
  • tailed ; مثال
  • looped ; مثال
  • stretched ; مثال
rquote
The closing quote mark (depends on dir) to enclose the content. The default value is "&quot;".

Examples

<math>

  <ms lquote="„" rquote="“"> abc </ms>

</math>

Specifications

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

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome No support NoEdge ? Firefox Full support 1IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
dirChrome No support NoEdge ? Firefox Full support 12IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 14Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
hrefChrome No support NoEdge ? Firefox Full support 7IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 7Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
mathsizeChrome No support NoEdge ? Firefox Full support 1IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
mathvariantChrome No support NoEdge ? Firefox Full support 28IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 28Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown

Gecko-specific notes

  • Starting with Gecko 20.0 (Firefox 20.0 / Thunderbird 20.0 / SeaMonkey 2.17) a unitless value for mathsize is allowed.
  • 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.

 

Document Tags and Contributors

Contributors to this page: fscholz, fred.wang, Sheppy, jswisher
Last updated by: fscholz,