HTML5 MathML
HTML5 MathML <menclose> Tag
The <menclose> element draws enclosing notation - a box, circle, overline or strike-through - around the expression it contains. The kind of enclosure is chosen with the notation attribute.
Definition and Usage
Use <menclose> to visually mark part of a formula: box a result, circle a term, strike out a cancelled factor, or draw a long-division sign. One or more space-separated notation values can be combined.
Syntax
Example
<menclose notation="box">
<mrow>...</mrow>
</menclose>Common notation Values
| Value | Effect |
|---|---|
| box | Draws a rectangle around the content. |
| circle | Draws an ellipse around the content. |
| roundedbox | Draws a rounded rectangle. |
| top / bottom / left / right | Draws a line on the named side. |
| updiagonalstrike | Diagonal strike from bottom-left to top-right. |
| downdiagonalstrike | Diagonal strike from top-left to bottom-right. |
| horizontalstrike | Horizontal line through the content. |
| longdiv | Long-division enclosure. |
Example
Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MathML menclose</title>
</head>
<body>
<math display="block">
<mrow>
<mi>x</mi><mo>=</mo>
<menclose notation="box">
<mrow><mn>7</mn></mrow>
</menclose>
</mrow>
</math>
</body>
</html>⚠️
<menclose> is not part of the MathML Core baseline. Support varies: Firefox renders many notation values, but some Chromium builds ignore it. Test in your target browsers or provide a CSS fallback.
Key Takeaways
- <menclose> surrounds an expression with visual notation.
- The notation attribute picks the enclosure - box, circle, strike and more.
- Combine multiple values with spaces; support is strongest in Firefox.
