HTML5 MathMLSE CONNECTER

HTML5 MathML

Qu'est-ce que MathML

MathML est un langage de balisage mathématique, un standard basé sur XML (un sous-ensemble du langage de balisage généralisé standard), utilisé dans un balisage langage pour écrire des symboles et des formules mathématiques sur Internet.

HTML5 peut utiliser des éléments MathML dans les documents, et les balises correspondantes sont <math>...</math>

Remarque : La plupart des navigateurs prennent en charge la balise MathML. Si votre navigateur ne prend pas en charge cette balise, vous pouvez utiliser la dernière version du navigateur Firefox ou Safari pour l'afficher.


Exemple MathML

Ce qui suit est un exemple MathML simple :

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>php中文网(php.cn)</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>

Résultats d'exécution du programme :

6.jpg


Les exemples suivants ajoutent des opérateurs :

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>php中文网(php.cn)</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>

Résultats de l'exécution du programme :

8.jpg


L'exemple suivant est une matrice 2×2, l'effet peut être visualisé dans Firefox 3.5 ou supérieur :

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>php中文网(php.cn)</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>

Résultats en cours d'exécution du programme :

6.jpg





section suivante
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>php中文网(php.cn)</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>
soumettreRéinitialiser le code
chapitredidacticiel