Latest web development tutorials

HTML5 MathML

HTML5 dapat digunakan dalam dokumen elemen MathML tag yang sesuai adalah <math> ... </ math>.

MathML adalah Matematika Markup Language, adalah XML (subset dari Standard Generalized Markup Language) standar berbasis untuk menulis simbol matematika dan bahasa formula markup di Internet.

Catatan: Sebagian besar browser mendukung tag MathML, jika browser Anda tidak mendukung tag ini, Anda dapat menggunakan versi terbaru dari Firefox atau Safari browser.


Contoh MathML

Berikut ini adalah contoh MathML sederhana:

<!DOCTYPE html>
<html>
   <head>
      <meta charset="UTF-8">
      <title>本教程(w3big.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> 

Coba »

Gambar hasil operasi, sebagai berikut:

Contoh berikut menambahkan beberapa operator:

<!DOCTYPE html>
<html>
   <head>
      <meta charset="UTF-8">
      <title>本教程(w3big.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> 

Coba »

Gambar hasil operasi, sebagai berikut:

Contoh berikut adalah 2 × 2 matriks, Anda dapat melihat efek di Firefox 3.5 dan di atas:

<!DOCTYPE html>
<html>
   <head>
      <meta charset="UTF-8">
      <title>本教程(w3big.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> 

Coba »

Gambar hasil operasi, sebagai berikut: