Latest web development tutorials

HTML5 MathML

HTML5 pode ser utilizado nos elementos de MathML documento tag correspondentes é <matemática> ... </ matemática>.

MathML é o Mathematical Markup Language, é um XML (um subconjunto da Standard Generalized Markup Language) padrão baseado para escrever símbolos matemáticos e fórmulas de idioma de marcação na Internet.

Nota: A maioria dos navegadores suportam MathML tag, se o seu navegador não suporta esta tag, você pode usar a versão mais recente do navegador Firefox ou Safari.


Exemplos de MathML

O que se segue é um exemplo simples MathML:

<!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> 

tente »

FIG operando resultados, como se segue:

O exemplo a seguir adiciona alguns operadores:

<!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> 

tente »

FIG operando resultados, como se segue:

O exemplo a seguir é uma matriz 2 × 2, você pode ver o efeito no Firefox 3.5 e acima:

<!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> 

tente »

FIG operando resultados, como se segue: