mathsize

已弃用: 不再推荐使用该特性。虽然一些浏览器仍然支持它,但也许已从相关的 web 标准中移除,也许正准备移除或出于兼容性而保留。请尽量不要使用该特性,并更新现有的代码;参见本页面底部的兼容性表格以指导你作出决定。请注意,该特性随时可能无法正常工作。

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 长度

规范

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

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

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
mathsize
Deprecated
Named spaces (e.g. thinmathspace to mean 3/18em)
DeprecatedNon-standard
Nonzero unitless values (e.g. 5 to mean 500%)
DeprecatedNon-standard
small, normal, big values
DeprecatedNon-standard

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
No support
No support
Non-standard. Check cross-browser support before using.
Deprecated. Not for use in new websites.
See implementation notes.
Has more compatibility info.

参见