The HTML5 MathML <mspace> tag is used to insert customizable space within a mathematical expression. It allows you to control the width, height, and depth of the space for precise formatting. The size of the blank space has to be mentioned in the attributes.
Syntax
<mspace attributes="value"/>Attributes
This tag accepts some attributes which are listed below:
| Attribute | Description |
|---|---|
| class|id|style | Holds the styles of the child elements. |
| mathbackground | Holds the background color value for math expressions. |
| depth | Holds the desired depth below the baseline. |
| width | Holds the width value length. |
| height | Holds the desired height above the baseline. |
| linebreak | Defines line breaks inside a line; possible values: auto, newline, nobreak, goodbreak, badbreak. |
Below example illustrates the MathML <mspace> tag in HTML5:
Example: In this example we demonstrates the usage of the HTML5 MathML <mfenced> and <mspace> tags to display a mathematical expression. It includes superscripts and adjustable spacing between elements.
<!DOCTYPE html>
<html>
<head>
<title>HTML5 MathML mfenched tag</title>
</head>
<body>
<center>
<h1 style="color:green">
GeeksforGeeks
</h1>
<h3>HTML5 MathML <mspace> tag</h3>
<math>
<mfenced open="(" close=")" separators="">
<mrow>
<msup>
<mi>x</mi>
<mn>2</mn>
</msup>
<mspace depth="20px" height="40px" />
<mo>+</mo>
<msup>
<mi>y</mi>
<mn>2</mn>
</msup>
<mo>=</mo>
<msup>
<mi>z</mi>
<mn>2</mn>
</msup>
</mrow>
</mfenched>
</math>
</center>
</body>
</html>
Output:

Supported Browsers
The browsers supported by HTML5 MathML <space> tag are listed below:
- Firefox