Mainly in the code specification, the XHTML specification will be more stringent

XHTML elements must be nested correctly

  • Correct demonstration

    <b><i>This text is bold and italic</i></b>
  • Error model

    <b><i>This text is bold and italic</b></i>

The XHTML element must be closed

  • Correct demonstration

    <p>This is a paragraph</p>
    <p>This is another paragraph</p>
    
    A break: <br />
    A horizontal rule: <hr />
    An image: <img src="happy.gif" alt="Happy face" />
  • Error model

    <p>This is a paragraph
    <p>This is another paragraph
    
    A break: <br>
    A horizontal rule: <hr>
    An image: <img src="happy.gif" alt="Happy face">

Tag names must be in lowercase letters

  • Correct demonstration

    <body>
        <p>This is a paragraph</p>
    </body>
  • Error model

    <BODY>
        <P>This is a paragraph</P>
    </BODY>

An XHTML document must have a root element

  • All XHTML elements must be nested within the root element

    <html>
    <head> ... </head>
    <body> ... </body>
    </html>

additional

  • This article is published through multiple platforms of “We Media” and will not be maintained after publication. If you have any objection to the content, you can discuss it in the GitHub below
  • The ongoing maintenance / 500 + face questions before update/notes 】 https://github.com/noxussj/In…
  • [3D city modeling using three. JS (Zhuhai City)] https://3d.noxussj.top/