HTML5 | MathML <mphantom> Tag

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:



filter_none

edit
close

play_arrow

link
brightness_4
code

<!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>

chevron_right


Output:

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

  • Firefox

full-stack-img




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.