Open In App

HTML5 MathML display Attribute

This attribute holds the value of rendering of HTML element. There can be two value block which means that this element will be displayed outside the current span of text, inline which means that this element will be displayed inside the current span of text. This attribute is accepted by <math> tag only.

Syntax:



<element display="block|inline">

Attribute Values:

Below example illustrate the display attribute of HTML5 MathML:



Example:




<!DOCTYPE html> 
<html
  
<head
    <title>HTML5 MathML display attribute</title
</head
  
<body
    <center
        <h1 style="color:green"
            GeeksforGeeks 
        </h1
          
        <h3>HTML5 MathML display attribute</h3
          
        <math display="block"
            <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
    </center
</body
  
</html>

Output: 

Supported Browsers: The browsers supported by display attribute are listed below:


Article Tags :