Skip to content
Related Articles

Related Articles

HTML5 | MathML <mphantom> Tag

View Discussion
Improve Article
Save Article
  • Last Updated : 19 Aug, 2021

The MathML <mphantom> tag in HTML5 is used to rendered invisibly but the dimensional are still kept.
Syntax: 
 

<mphantom> Child elements </mphantom>

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

  • class|id|style: This attribute is used to hold the styles of the child elements.
  • mathbackground: This attribute holds the value of the math expressions background color. 
     

Below example will illustrates the concept of HTML 5 MathML <mphantom> tag:
Example: 
 

html




<!DOCTYPE html>
<html>
 
<head>
    <title>HTML5 mphantom tag</title>
</head>
 
<body style="text-align:center;">
     
    <h1 style="color:green">GeeksforGeeks</h1>
     
    <h3>HTML5 MathML <mphantom> tag</h3>
     
    <math>
        <maction actiontype="toggle">
            <mfrac>
                <mn>25</mn>
                <mn>10</mn>
            </mfrac>
            <mfrac>
                <mrow>
                    <mphantom>
                        <mn>5</mn>
                        <mo>⋅</mo>
                        <mn>5</mn>
                    </mphantom>
                </mrow>
                <mrow>
                    <mphantom>
                        <mn>2</mn>
                        <mo>⋅</mo>
                        <mn>5</mn>
                    </mphantom>
                </mrow>
            </mfrac>
            <mfrac>
                <mn>2</mn>
                <mn>5</mn>
            </mfrac>
        </maction>
    </math>
     
     
<p>
        By clicking the number you can
        see 5*5 and 2*5 is invisible
    </p>
 
</body>
 
</html>

Output: 
 

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

  • Firefox
  • Safari

 


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!