HTML5 MathML
HTML5 MathML mathsize Attribute
The mathsize attribute sets the font size of a MathML element's content. It accepts CSS lengths and the keywords small, normal and big, letting you scale individual symbols.
Definition and Usage
Apply mathsize to token elements such as <mi>, <mn> and <mo> to enlarge or shrink them relative to the surrounding formula. Values may be absolute (16px), relative (1.5em, 150%) or the keywords small, normal and big.
Syntax
Example
<mi mathsize="2em">x</mi>Example
This makes one variable noticeably larger than the rest of the expression.
Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MathML mathsize attribute</title>
</head>
<body>
<math display="block">
<mrow>
<mi mathsize="2em">∑</mi>
<mi>x</mi>
</mrow>
</math>
</body>
</html>💡
In MathML Core the CSS font-size property has the same effect as mathsize and is often preferable for consistency with your stylesheet.
Key Takeaways
- mathsize sets the font size of an element's content.
- Values include px, em, percentages and small/normal/big.
- CSS font-size is an equivalent modern approach.
