美文网首页
HTML5 MathML

HTML5 MathML

作者: 龍飝 | 来源:发表于2018-03-20 10:17 被阅读6次

HTML5可以在文档中使用 MathML元素,对应的变迁是<math>....</math>
MathML是数学标记语言,是一种基于XML的标准,用于互联网上书写数学符号和公式的置标语言

注意:大部分浏览器都支持MathML标签,如果你的浏览器不支持该标签,可以使用最新版火狐或 Safari浏览器查看

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>
运行结果: a2 + b2 = c2

一下实例添加一些运算符:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>菜鸟教程(runoob.com)</title>
</head>

<body>

  <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>
运行结果: x 2 + 4 ⁢ x + 4 = 0

以下实例是一个 2×2 矩阵,可以在 Firefox 3.5 以上版本查看到效果:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>菜鸟教程(runoob.com)</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>

相关文章

  • HTML5 MathML

    HTML5 MathML HTML5 可以在文档中使用 MathML 元素,对应的标签是 ...

  • HTML5_MathML

    HTML5 MathML HTML5 可以在文档中使用 MathML 元素,对应的标签是 ...

  • HTML5 MathML

    HTML5 可以在文档中使用 MathML 元素,对应的标签是 ... 。MathML ...

  • HTML5 MathML

    HTML5可以在文档中使用 MathML元素,对应的变迁是....MathML是数学标记...

  • HTML MathML

  • 公式编辑器

    1、确定开发方案,以mathml结构来渲染和编辑html。在前端将latex转化为mathml,在后端将mathm...

  • html5--day2-3

    1.SVG 将SVG嵌入HTML页面 2.MathML MathML是一种数学标记语言,对应标签为.....

  • Latex公式转为Word公式

    1.点击网址texmath demo在线转换为MathML2.将MathML粘贴到文本编辑器中,比如记事本中3.在...

  • 分享 | 如何在Word中快速直接地插入Latex公式

    工具准备 Mathpix Snipping:https://mathpix.com/ MathML:https:/...

  • 2022-05-19

网友评论

      本文标题:HTML5 MathML

      本文链接:https://www.haomeiwen.com/subject/xqsvqftx.html