在HTML5中使用MathML数学公式的简单讲解

2020-04-25 07:54:22易采站长站整理

             <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>   

这会生成如下结果

复制代码x 2 + 4 x + 4 = 0
便于学习这一概念 – 请使用 FireFox 3.7 或更高版本进行在线练习。

矩阵表达示例
想象一下下面的例子,它会被用来表示一个简单的 2×2 矩阵:

XML/HTML Code复制内容到剪贴板

html   
<!doctype html>  
  <html>  
  <head>  
  <meta charset="UTF-8">  
  <title>MathML Examples</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>