其他分享
首页 > 其他分享> > HTML5 - MathML(四)

HTML5 - MathML(四)

作者:互联网

HTML5 MathML

MathML 简介

MathML 实例

<!DOCTYPE html>
<html>
   <head>
      <meta charset="UTF-8">
      <title>MathML 实例1</title>
   </head>    
   <body> 
       <p>
           MathML 实现数学公式:a平方 + b平方 = c平方
       </p>
      <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>MathML 实例22</title>
   </head>
   <body>
       <p>
           MathML 实现一元二次方程
       </p>
      <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>
<!DOCTYPE html>
<html>
   <head>
      <meta charset="UTF-8">
      <title>MathML 实例3</title>
   </head>
   <body>
       <p>
           MathML 实现数学矩阵
       </p>
      <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>

标签:平方,MathML,实现,实例,数学,HTML5
来源: https://www.cnblogs.com/xdy-/p/13467573.html