Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML5 MathML

HTML5 MathML

HTML5 can use MathML elements in documents; the corresponding tag is ... 。

MathML is a mathematical markup language, a standard based on XML (a subset of the Standard Generalized Markup Language), used as a markup language for writing mathematical symbols and formulas on the Internet.

Note:Currently only Firefox or Safari browsers support it, and most browsers do not yet support MathML tags. If your browser does not support this tag, you can use the latest version of Firefox or Safari to view it.

In addition, we can use third-party style libraries to support mathematical markup. The style library used in this chapter can be downloaded by clicking the button below:

Download mathml.zip


MathML Examples

The following is a simple MathML example:

Example

   

     

     

<p>Runoob Tutorial(runoob.com)</p>

   

       

   

       

     

               

         

           

a

2

           

                               

           

b

2

           

=

                               

           

c

2

         

                       

     

               

   

Try it »

Use a third-party library to support it:

Example

   

     

     

<p>Runoob Tutorial(runoob.com)</p>

     

   

       

   

       

     

               

         

           

a

2

           

                               

           

b

2

           

=

                               

           

c

2

         

                       

     

               

   

Try it »

The running result is shown below:

The following example adds some operators:

Example

   

     

     

<p>Runoob Tutorial(runoob.com)</p>

   

       

   

       

     

               

         

               

           

                               

               

                 

x

                 

2

               

                                       

               

                                       

               

                 

4

                 

⁢

                 

x

               

                                       

               

               

4

                                       

           

                               

           

=

           

0

                                 

         

     

               

   

Try it »

Use a third-party library to support it:

Example

   

     

     

<p>Runoob Tutorial(runoob.com)</p>

     

   

       

   

       

     

               

         

               

           

                               

               

                 

x

                 

2

               

                                       

               

                                       

               

                 

4

                 

x

               

                                       

               

               

4

                                       

           

                               

           

=

           

0

                                 

         

     

               

   

Try it »

The running result is shown below:

The following example is a 2×2 matrix, which can be viewed in Firefox 3.5 and above:

Example

   

     

     

<p>Runoob Tutorial(runoob.com)</p>

   

       

   

     

               

         

           

A

           

=

                       

           

                       

               

                 

                     

x

                     

y

                 

                                       

                 

                     

z

                     

w

                 

               

               

           

         

     

     

   

Try it »

Use a third-party library to support it:

Example

   

     

     

<p>Runoob Tutorial(runoob.com)</p>

     

   

       

   

     

               

         

           

A

           

=

                       

           

                       

               

                 

                     

x

                     

y

                 

                                       

                 

                     

z

                     

w

                 

               

               

           

         

     

     

   

Try it »

The running result is shown below: