XHTML5 = HTML5 + XML

Savez-vous que l'HTML5 peut s'écrire de deux manières différentes ?

La manière HTML4 :


<!doctype html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Example document</title>
  </head>
  <body>
    <p>Example paragraph</p>
  </body>
</html>

La manière XML compatible XHTML1 :


<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="https://www.w3.org/1999/xhtml">
  <head>
    <title>Example document</title>
  </head>
  <body>
    <p>Example paragraph</p>
  </body>
</html>

Chapitre 2 du document W3C "HTML5 differences from HTML4"

HTML5 defines an HTML syntax that is compatible with HTML4 and XHTML1 documents published on the Web

Lorsque la syntaxe XML est utilisée dans une page Web HTML5, on parle alors de XHTML 5 ;-)