<msup>

MathML <msup> 元素用于为表达式加上标。

语法如下:<msup> base superscript </msup>

属性

class, id, style
用来供样式表使用。
href
用来设置标签点击后跳转的链接。
mathbackground
用来设置背景色,可以使用 #rgb#rrggbb 或者 HTML 颜色名
mathcolor
用来设置文字颜色,同样可以使用 #rgb#rrggbb 或者 HTML 颜色名
superscriptshift
用来设置上标相对于表达式的基线的最小距离,它是一个长度值
此属性已被弃用,且将在未来被删除。

例子

下述代码表示:x1

您的浏览器的渲染结果: X 2

<math>

  <msup>
    <mi>X</mi>
    <mn>2</mn>
  </msup> 

</math>

规范

规范 状态 备注
MathML 3.0
msup
Recommendation Current specification
MathML 2.0
msup
Recommendation Initial specification

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
msupChrome No support NoEdge No support NoFirefox Full support 1IE No support NoOpera No support NoSafari Full support 6WebView Android No support NoChrome Android No support NoFirefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
hrefChrome No support NoEdge No support NoFirefox Full support 7IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoFirefox Android Full support 7Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
mathbackgroundChrome No support NoEdge No support NoFirefox Full support 4IE No support NoOpera No support NoSafari Full support 6WebView Android No support NoChrome Android No support NoFirefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
mathcolorChrome No support NoEdge No support NoFirefox Full support 4IE No support NoOpera No support NoSafari Full support 6WebView Android No support NoChrome Android No support NoFirefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
superscriptshiftChrome No support NoEdge No support NoFirefox Full support 1IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoFirefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No

Legend

Full support  
Full support
No support  
No support

Gecko说明

  • 从 Gecko 26.0 (Firefox 26 / Thunderbird 26 / SeaMonkey 2.23 / Firefox OS 1.2) 开始,不再支持使用 <none /> 作为子元素。并且渲染结果和 <msub><mmultiscripts> 这些等价配置更加接近,同时修复了一个关于 superscriptshift 属性错误使用的问题(参阅 bug 827713).

参见