The deprecated MathML <mfenced>
element used to provide the possibility to add custom opening and closing parentheses (such as brackets) and separators (such as commas or semicolons) to an expression. It has been removed from the latest MathML standard and modern browsers no longer support it. Use the <mrow>
and <mo>
elements instead.
Attributes
class
,id
,style
- Provided for use with stylesheets.
close
- A string for the closing delimiter. The default value is
")
" and any white space is trimmed. 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 and also the fraction line color. You can use
#rgb
,#rrggbb
and HTML color names. open
- A string for the opening delimiter. The default value is
"("
and any white space is trimmed. separators
- A sequence of zero or more characters to be used for different separators, optionally divided by white space, which is ignored. The default value is ",". By specifying more than one character, it is possible to set different separators for each argument in the expression. If there are too many separators, all excess is ignored. If there are too few separators in the expression, the last specified separator is repeated.
Examples
The last separator is repeated (,
)
Sample rendering:
Rendering in your browser:
<math> <mfenced open="{" close="}" separators=";;,"> <mi>a</mi> <mi>b</mi> <mi>c</mi> <mi>d</mi> <mi>e</mi> </mfenced> </math>
All excess is ignored (,
)
Sample rendering:
Rendering in your browser:
<math> <mfenced open="[" close="]" separators="||||,"> <mi>a</mi> <mi>b</mi> <mi>c</mi> <mi>d</mi> <mi>e</mi> </mfenced> </math>
Specifications
The <mfenced> element is no longer part of the latest MathML standard. Use the <mrow>
and <mo>
elements instead, or, for backwards compatibility, see mathml-polyfills/mfenced.
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
mfenced | Chrome No support No | Edge No support No | Firefox No support 1 — 73 | 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 Full support 6 | Samsung Internet Android No support No |
href | Chrome No support No | Edge No support No | Firefox No support 7 — 73 | IE No support No | Opera No support No | Safari Full support 10 | 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 |
mathbackground | Chrome No support No | Edge No support No | Firefox No support 4 — 73 | 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 |
mathcolor | Chrome No support No | Edge No support No | Firefox No support 4 — 73 | 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 |
Legend
- Full support
- Full support
- No support
- No support
- Non-standard. Expect poor cross-browser support.
- Non-standard. Expect poor cross-browser support.
- Deprecated. Not for use in new websites.
- Deprecated. Not for use in new websites.