我试图显示一个简单的等式,但它不起作用.我的代码如下(html5):
<math xmlns="http://www.w3.org/1998/Math/MathML" display = 'block'>
<mrow>
<msub>
<mi>a</mi>
<mi>i</mi>
</msub>
<mo>=</mo>
<msub>
<mi>a</mi>
<mi>z</mi>
</msub>
<sin/>
<mi mathvariant='normal' fontfamily='Times New Roman'>?</mi>
<mo>−</mo>
<msub>
<mi>a</mi>
<mi>x</mi>
</msub>
<cos/>
<mi mathvariant='normal' fontfamily='Times New Roman'>?</mi>
</mrow>
</math>
Run Code Online (Sandbox Code Playgroud)
在Opera或Chrome中,我既看不到三角运算,也看不到子指数.在Firefox中,我可以看到子指标,但不能看到三角函数.有人可以说错误在哪里吗?提前致谢.
Pet*_*ger 10
答案很简单:Chrome,Opera和IE不支持MathML.
Firefox有一个非常可靠的实现(但还没有完成),Safari只是一个非常局部的实现.Firefox和Safari都不支持Content MathML.
这就是为什么你需要使用像MathJax(cf MathML支持)或jqmath这样的polyfill.
这些polyfill都不支持Content MathML,因此您需要遵循MvG的建议来生成Presentation MathML.
在较旧的IE(6-9)上,用户可以安装MathPlayer插件,这是支持所有Presentation和Content MathML的唯一实现.