Open In App

HTML5 MathML mathcolor Attribute

Improve
Improve
Like Article
Like
Save
Share
Report

The MathML mathcolor attribute in HTML5 is used to specify the foreground color to be used in the math expressions. The colors can be defined in any form that can be either in RGB or any string color name. This attribute is accepted by all the MathML tags.

Syntax:

<element mathcolor="colorname">

Attribute Values: This attribute has a single value as mentioned above and described below:

  • colorname: It is the value that defines the color to be used for the MathML tag.

The example below illustrates the MathML mathcolor attribute:

Example: 

HTML




<!DOCTYPE html>
<html>
  
<body style="text-align:center;">
    <h1 style="color:green">
        GeeksforGeeks
    </h1>
  
    <h3>HTML5 MathML mathcolor Attribute</h3>
      
    <math>
        <ms lquote="„" rquote=" “" 
            mathcolor="Yellow" mathbackground="Purple">
            A Computer Science Portal for Geeks
        </ms>
    </math>
</body>
  
</html>


Output:

Supported Browsers: The browsers supported by HTML5 MathML mathcolor attribute are listed below:

  • Firefox

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