您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

HTML5 MathML 数学公式

html5 可以在文档中使用 <math> MathML 数学公式

MathML 是数学语言,是一种基于XML(标准通用语言的子集)的标准,用来在互联网上书写数学符号和公式的置标语言

大部分浏览器都 MathML
如果你的浏览器该,可以使用最新版的 Firefox 或 Safari 浏览器查看

下面的范例演示了最基本的 MathML

<!DOCTYPE html>
< charset="UTF-8">
<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>

在浏览器中如下

下面的范例演示了一些运算符

<!DOCTYPE html>
< charset="UTF-8">
<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>

在浏览器中如下:

范例 3

下面的范例演示了 2×2 矩阵,可以在 Firefox 3.5+ 或 Safari 查看到

<!DOCTYPE html>
< charset="UTF-8">
<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>

在浏览器中如下:


联系我
置顶