The HTML5 MathML <ms> tag is used to represent a string literal in mathematical notation. It allows developers to display text as part of a mathematical expression, typically enclosed in quotation marks.
Syntax
<ms lquotes="„" rquote="“"> String Expression </ms>Attributes
This tag accepts some attributes which are listed below:
| Attribute | Description |
|---|---|
class/id/style | Holds the styles of child elements. |
dir | Specifies text direction: ltr (left-to-right) or rtl (right-to-left). |
href | Holds a hyperlink to a specified URL. |
mathbackground | Sets the background color of math expressions. |
mathcolor | Defines the color of math expressions. |
mathsize | Specifies size of the content: small, medium, big. |
mathvariant | Determines typography variety (like font-family). |
lquote | Sets the opening quote based on dir attribute, default value is ". |
Below example will illustrates the concept of HTML5 MathML <ms> tag:
Example: In this example we demonstrates the use of the HTML5 MathML <ms> tag to display styled mathematical text with specific left and right quotes, background color, and text color.
<!DOCTYPE html>
<html>
<head>
<title>HTML5 MathML ms tag</title>
</head>
<body style="text-align:center;">
<h1 style="color:green">GeeksforGeeks</h1>
<h3>HTML5 MathML <ms> Tag</h3>
<math>
<ms lquote="„"
rquote="“"
mathcolor="Yellow"
mathbackground="Purple">
A Computer Science Portal for Geeks
</ms>
</math>
</body>
</html>
Output:

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