html5 的 html 语法允许我们在文档内使用 ... 标签应用 mathml 元素。
下面是一个使用 mathml 的有效 html5 文档:
xml/html code复制内容到剪贴板
html nbsp;html> html> head> meta charset=utf-8> title>pythagorean theoremtitle> head> body> math xmlns=http://www.w3.org/1998/math/mathml> mrow> msup>mi>ami>mn>2mn>msup> mo>+mo> msup>mi>bmi>mn>2mn>msup> mo>=mo> msup>mi>cmi>mn>2mn>msup> mrow> math> body> html>
这会生成如下结果:
复制代码
代码如下:
a2 + b2 = c2
便于学习这一概念 - 请使用 firefox 3.7 或更高版本进行在线练习。使用 mathml 字符
想象一下,下面是一个使用字符 &invisibletimes; 的标记:
xml/html code复制内容到剪贴板
html nbsp;html> html> head> meta charset=utf-8> title>mathml examplestitle> head> body> math xmlns=http://www.w3.org/1998/math/mathml> mrow> mrow> msup> mi>xmi> mn>2mn> msup> mo>+mo> mrow> mn>4mn> mo>mo> mi>xmi> mrow> mo>+mo> mn>4mn> mrow> mo>=mo> mn>0mn> mrow> math> body> html>
这会生成如下结果
复制代码
代码如下:
x 2 + 4 x + 4 = 0
便于学习这一概念 - 请使用 firefox 3.7 或更高版本进行在线练习。矩阵表达示例
想象一下下面的例子,它会被用来表示一个简单的 2x2 矩阵:
xml/html code复制内容到剪贴板
html nbsp;html> html> head> meta charset=utf-8> title>mathml examplestitle> head> body> math xmlns=http://www.w3.org/1998/math/mathml> mrow> mi>ami> mo>=mo> mfenced open=[ close=]> mtable> mtr> mtd>mi>xmi>mtd> mtd>mi>ymi>mtd> mtr> mtr> mtd>mi>zmi>mtd> mtd>mi>wmi>mtd> mtr> mtable> mfenced> mrow> math> body> html>
这会生成如下结果