MyInternships.in

HTML5 MathML

HTML5 MathML close Attribute

The close attribute belongs to the <mfenced> element and sets the character used as the closing fence (bracket). It works together with the open attribute to wrap content in a bracket pair.


Definition and Usage

By default <mfenced> closes with a round bracket ). Set close to any single character - such as ], } or | - to change the closing fence. Because <mfenced> is deprecated, close is mainly encountered in older documents.

Syntax

Setting the closing fence
Example
<mfenced open="[" close="]">
  <mi>x</mi>
</mfenced>

Example

Square-bracket fences
Example
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>MathML close attribute</title>
</head>
<body>
  <math display="block">
    <mfenced open="[" close="]" separators=",">
      <mi>a</mi>
      <mi>b</mi>
    </mfenced>
  </math>
</body>
</html>
⚠️

<mfenced> and its close attribute are deprecated and not in MathML Core. Prefer an explicit <mo>]</mo> closing operator for reliable rendering.

Key Takeaways

  • close sets the closing fence character on <mfenced>.
  • It pairs with open to form a bracket pair.
  • Deprecated - use an explicit closing <mo> instead.

Related HTML Topics

Keep learning with these closely related tutorials.

Ready to use your HTML skills?

Find web development internships and fresher jobs across India.

Browse Web Dev Internships