2024.11.21

MathML 实例

以下是一个简单的 MathML 实例:

实例

<!DOCTYPE html>
<html>
   <head>
      <meta charset="UTF-8">
      <title>菜鸟教程(runoob.com)</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>菜鸟教程(runoob.com)</title>
      <script type="text/javascript" src="https://static.jyshare.com/assets/js/mathml/mspace.js"></script>
   </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>


运行结果图,如下所示:

posted @ 2025-01-07 22:36  y龙  阅读(6)  评论(0)    收藏  举报