HTML5 教程
HTML5 可以在文檔中使用 MathML 元素,對應(yīng)的標(biāo)簽是 <math>...</math> 。
MathML 是數(shù)學(xué)標(biāo)記語言,是一種基于XML(標(biāo)準(zhǔn)通用標(biāo)記語言的子集)的標(biāo)準(zhǔn),用來在互聯(lián)網(wǎng)上書寫數(shù)學(xué)符號和公式的置標(biāo)語言。
注意:大部分瀏覽器都支持 MathML 標(biāo)簽,如果你的瀏覽器不支持該標(biāo)簽,可以使用最新版的 Firefox 或 Safari 瀏覽器查看。
以下是一個簡單的 MathML 實(shí)例:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>小白教程(json.cn)</title> </head> ???? <body> ???? <math xmlns="http://www.w3.org/1998/Math/MathML"> ???????? <mrow> <msup><mi>a</mi><mn>2</mn></msup> <mo>+</mo> ???????????????? <msup><mi>b</mi><mn>2</mn></msup> <mo>=</mo> ???????????????? <msup><mi>c</mi><mn>2</mn></msup> </mrow> ???????????? </math> ???????? </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>小白教程(json.cn)</title> </head> ???? <body> ???? <math xmlns="http://www.w3.org/1998/Math/MathML"> ???????? <mrow>???????????? <mrow> ???????????????? <msup> <mi>x</mi> <mn>2</mn> </msup> ???????????????????? <mo>+</mo> ???????????????????? <mrow> <mn>4</mn> <mo>?</mo> <mi>x</mi> </mrow> ???????????????????? <mo>+</mo> <mn>4</mn> ???????????????????? </mrow> ???????????????? <mo>=</mo> <mn>0</mn> ???????????????? </mrow> </math> ???????? </body> </html>
以下實(shí)例是一個 2×2 矩陣,可以在 Firefox 3.5 以上版本查看到效果:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>小白教程(json.cn)</title> </head> ???? <body> <math xmlns="http://www.w3.org/1998/Math/MathML"> ???????? <mrow> <mi>A</mi> <mo>=</mo> ???????????? <mfenced open="[" close="]"> ???????????? <mtable> <mtr> <mtd><mi>x</mi></mtd> <mtd><mi>y</mi></mtd> </mtr> ???????????????????? <mtr> <mtd><mi>z</mi></mtd> <mtd><mi>w</mi></mtd> </mtr> </mtable> </mfenced> </mrow> </math> </body> </html>