HTML5 | MathML <mo> Tag

The MathML <mo> tag in HTML5 is used print operator between elements. Any kind of mathematical operator can be used by this tag.

Syntax:

<mo> operator </mo>

Attributes: This tag accepts some attributes which are listed below:



  • accent: This attribute is used to specifies whether the operator should be treated as an accent. Possible values are true or false.
  • class|id|style: This attribute is used to hold the styles of the child elements.
  • href: This attribute is used to hold any hyperlink to a specified URL.
  • fence: This attribute specifies whether the operator is a fence or not. Possible values are true or false.
  • form: This attribute is used to specify the role of the operator in case of normal operator like +, – it is not required. Possible values are prefix, infix and postfix.
  • largeop: This operator is used to define whether the operator should be drawn larger than normal when displaystyle="true" is set. Possible value are true or false.
  • lspace: This attribute holds the value of the space length before the operator default value is thickmathspace (4.32px).
  • rspace: This attribute holds the value of the space length after the operator default value is thickmathspace (4.32px).
  • mathbackground: This attribute holds the value of the math expressions background color.
  • mathcolor: This attribute holds the color of the math expressions.
  • dir: This attributes holds the direction two types of direction values is acceptable ltr (left to right) and rtl (right to left).
  • mathsize: This attribute holds the value of the size for the content. The possible values are small, medium and big.
  • mathvariant: This attribute holds variety of typography like font-family.
  • separator: This attribute holds the separator for each string or anything you want to separate from anything.
  • stretchy: This attribute define whether the operator stretches to the size of the adjacent element or not. Possible values are true or false.
  • maxsize: If the stretchy is set to be true then this attribute holds the max size of the operator. Possible values are infinity or any length unit.
  • minsize: If the stretchy is set to be true then this attribute holds the min size of the operator. Possible values are infinity or any length unit.
  • symmetric: If the stretchy is set to be true then this attribute specifies whether the operator should be vertically symmetric around the imaginary math axis.

Below example illustrates the concept of HTML5 MathML <mo> tag:

Example:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<head>
    <title>HTML5 MathML mo tag</title>
</head>
  
<body style="text-align:center;">
      
    <h1 style="color:green">
        GeeksforGeeks
    </h1>
      
    <h3>HTML5 MathML <mo> Tag</h3>
      
    <math>
        <mrow>
            <mrow>
                <msup>
                    <mi>x</mi>
                    <mn>2</mn>
                </msup>
                <mo>+</mo>
                <msup>
                    <mi>y</mi>
                    <mn>2</mn>
                </msup>
            </mrow>
            <mo>=</mo>
            <msup>
                <mi>z</mi>
                <mn>2</mn>
            </msup>
        </mrow>
    </math>
</body>
  
</html>

chevron_right


Output:

Supported Browsers: The browsers are supported by HTML5 MathML <mo> tag are listed below:

  • Firefox



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.