Open In App

HTML5 MathML displaystyle Attribute

Improve
Improve
Like Article
Like
Save
Share
Report

This attribute contains a Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. This attribute is accepted by all the MathML tags.

Syntax:

<element displaystyle="true|false">

Attribute Values:

  • true: This value defines that more vertical space is used for displayed equations.
  • false: This value defines that more compact layout is used to display formulas.

Below examples illustrate the displaystyle attribute in HTM5 MathML

Example:

HTML




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

  • Firefox


Last Updated : 20 Nov, 2020
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads