HTML5 MathML stretchy Attribute

Last Updated : 23 Jul, 2025

This attribute defines whether the operator stretches to the size of the adjacent element or not. Possible values are true or false. This attribute is accepted by the <mo> tag only.

Syntax:

<element stretchy="true|false">

Attribute Values:

  • true: This value defines the operator stretches to the size of the adjacent element.
  • false: This value defines the operator stretches not to the size of the adjacent element.

The below example illustrates the stretchy Attribute:

Example:

HTML
<!DOCTYPE html> 
<html> 
<body style="text-align:center;"> 
    <h1 style="color:green"> 
        GeeksforGeeks 
    </h1> 
    <h3>HTML5 MathML stretchy Attribute</h3> 
    <math> 
        <mrow> 
            <mrow> 
                <msup> 
                    <mi>x</mi> 
                    <mn>2</mn> 
                </msup> 
                <mo stretchy="true">+</mo> 
                <msup> 
                    <mi>y</mi> 
                    <mn>2</mn> 
                </msup> 
            </mrow> 
            <mo stretchy="false">=</mo> 
            <msup> 
                <mi>z</mi> 
                <mn>2</mn> 
            </msup> 
        </mrow> 
    </math> 
</body> 
</html> 

Output:

The output of the above code

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

  • Firefox
Comment