Related Articles

Related Articles

HTML5 | MathML <msub> Tag
  • Last Updated : 08 Nov, 2019

The MathML <msub> tag in HTML is used to print the base power on any expression.

Syntax:

<msub> Contents </msub>

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

  • class|id|style: This attribute holds the style of the contents.
  • mathbackground: This attribute holds the value of the math expressions background color.
  • href: This attribute holds any hyperlink to a specified URL.
  • mathcolor: This attribute holds the color of the math expressions.
  • subscriptshift: This attribute defines the minimum space that shift the subscript below the baseline of the expression.

Below example illustrates the MathML <msub> tag in HTML5:

Example:



filter_none

edit
close

play_arrow

link
brightness_4
code

!DOCTYPE html>
<html>
  
<head>
    <title>HTML5 MathML msub tag</title>
</head>
  
<body>
    <center>
        <h1 style="color:green"
            GeeksforGeeks 
        </h1>
  
        <h3>HTML5 MathML <msub> tag</h3>
  
        <math>
            <mfenced open="(" close=")" separators="">
                <mrow>
                    <msub subscriptshift="5px">
                        <mi>x</mi>
                        <mn>2</mn>
                    </msub>
                    <mo>+</mo>
                    <msub>
                        <mi>y</mi>
                        <mn>2</mn>
                    </msub>
                    <mo>=</mo>
                    <msub subscriptshift="5px">
                        <mi>z</mi>
                        <mn>2</mn>
                    </msub>
                </mrow>
            </mfenched>
        </math>
    </center>
</body>
  
</html>                    

chevron_right


Output:

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

  • Firefox

full-stack-img




My Personal Notes arrow_drop_up
Recommended Articles
Page :