HTML5 MathML

HTML5 MathML <mfenced> Tag

The <mfenced> tag surrounds its child content with fences (brackets) and inserts separators between children. Its appearance is controlled by the open, close and separators attributes.


Definition and usage

The <mfenced> element provides a convenient shorthand for enclosing content in brackets. By default it uses parentheses, but the open and close attributes change the opening and closing fences, while separators lists the characters placed between each child.

Syntax

<mfenced open="(" close=")" separators=",">
  <!-- children -->
</mfenced>

Example

A coordinate pair using square brackets
<math>
  <mfenced open="[" close="]" separators=",">
    <mi>x</mi>
    <mi>y</mi>
  </mfenced>
</math>

This renders [x, y]. The single comma in separators is placed between the two children; with more children the separators string is applied in order.

⚠️

The <mfenced> element is deprecated and is not part of MathML Core. The recommended replacement is an <mrow> containing explicit <mo> fence operators, for example <mo>[</mo> ... <mo>]</mo>.

Ready to use your HTML skills?

Find web development internships and fresher jobs across India.

Browse Web Dev Internships