此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in English Always switch to English

mathsize

Deprecated

Avoid using this feature in new projects. Only MathML Core (a subset of MathML Full) is designed to work with web technologies, such as CSS. This feature may be a candidate for removal from web standards or browsers.

Consider using the following features instead: MathML.

mathsize 全局属性设置 MathML 元素的字体大小

备注:尽可能使用 CSS 对 MathML 进行样式设置。mathsize 属性只应包含在不支持 CSS 的应用程序中,并且如果设置的话,其将被 CSS font-size 属性值覆盖。

语法

html
<!-- <length> 值 -->
<math mathsize="12px">
<math mathsize="0.8em">

<!-- <percentage> 值 -->
<math mathsize="80%">

<length>

一个正的 <length> 值。对于大多数与字体相关的单位(例如 emex),字体大小是相对于父元素的字体大小的。

<percentage>

一个正的 <percentage> 值,相对于父元素的字体大小。

备注:一些浏览器可能还接受旧版 MathML 长度

规范

规范
MathML Core
# dfn-mathsize
  • 在 MathML 3 和更早版本中,支持关键字 smallnormalbig,以及 MathML3 特定的长度语法。自 MathML 核心版本以来,语法与 CSS <length-percentage> 值相匹配。

  • 此属性设计用于不支持 CSS 的 MathML 应用程序。自 MathML 核心版本以来,推荐使用等效的 CSS。

浏览器兼容性

参见