HTML5 MathML

HTML5 MathML <mglyph> Tag

The <mglyph> tag displays a glyph that is not available as a normal character - for example a specialised symbol supplied as an image. It behaves like a single character within the surrounding math.


Definition and usage

The <mglyph> element lets you insert a custom symbol into an expression when no Unicode character exists for it. It references an image with the src attribute and provides fallback text with the alt attribute, sizing it with width and height so it aligns with the surrounding characters.

Syntax

<mglyph src="symbol.png" width="16px" height="16px" alt="custom symbol" />

Example

Using a custom glyph as an identifier
<math>
  <mrow>
    <mi><mglyph src="omega.png" width="18px" height="18px" alt="omega" /></mi>
    <mo>=</mo>
    <mn>2</mn>
    <mi>&#960;</mi>
    <mi>f</mi>
  </mrow>
</math>

The <mglyph> stands in for a symbol, treated as an identifier here inside <mi>. The alt text keeps the formula accessible when the image cannot load.

⚠️

The <mglyph> element is not part of MathML Core and has limited browser support. Prefer real Unicode characters wherever possible for reliable, accessible rendering.

Ready to use your HTML skills?

Find web development internships and fresher jobs across India.

Browse Web Dev Internships