HTML5 MathML(數(shù)學(xué)標(biāo)記)
MathML 是一個 W3C 推薦標(biāo)準(zhǔn),旨在為標(biāo)記數(shù)學(xué)表達(dá)式定義一個 XML 詞匯表,用來在互聯(lián)網(wǎng)上書寫數(shù)學(xué)符號和公式的置標(biāo)語言。
HTML5 可以在文檔中使用 MathML 元素,對應(yīng)的標(biāo)簽是 <math>...</math> 。
勾股定理實例:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>php中文網(wǎng)(php.cn)</title> </head> <body> <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <msup><mi>X</mi><mn>2</mn></msup> <mo>+</mo> <msup><mi>Y</mi><mn>2</mn></msup> <mo>=</mo> <msup><mi>Z</mi><mn>2</mn></msup> </mrow> </math> </body> </html>
注意:使用Firefox火狐瀏覽器打開效果最好。其他瀏覽器可能會出現(xiàn)小BUG。
歐拉公式:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>php中文網(wǎng)(php.cn)</title> </head> <body> <math xmlns="http://www.w3.org/1998/Math/MathML"> <msup><mi>e</mi><mi>iπ</mi></msup> <mo>+</mo> <mn>1</mn> <mo>=</mo> <mn>0</mn> </math> </body> </html>
矩陣表達(dá)示例:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>php中文網(wǎng)(php.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>
注意:請使用Firefox火狐瀏覽器打開。