Use XHTML 1.0 Strict where special attention is needed

Source: Internet
Author: User
Tags lowercase

Always use lowercase letters, let quotes accompany attributes: All elements and attributes must be named with lowercase, and all attribute values must use double quotes.

Error: <a href= "index. HTML "class=internal>

Correct: <a href= "index. HTML "class=" Internal >

Close all elements: some elements in HTML are not necessarily closed. When the next element starts, the previous element is automatically closed. This is not allowed in XHTML. All elements must be closed, even if there is no content (such as ).

Error: <li>item 1

Correct: <li>item 1</li>

Error: <p>lorem ipsum dolor sit amet, consectetuer adipiscing.

Correct: <p>lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>

Error: <br>

Correct: <br/>

Error:

Correct:

Attributes cannot be reduced: in HTML, some attributes can be reduced. XHTML is not allowed to do so.

Error: <input type= "checkbox" id= "CheckBox1" name= "CheckBox1" checked>

Correct: <input type= "checkbox" id= "CheckBox1" name= "CheckBox1" checked= "checked"/>

Do not use excluded elements: some elements and attributes are allowed in HTML 4.01 Transitional and XHTML 1.0 Transitional, and are not supported under XHTML 1.0 Strict (and in HTML 4.01 Strict )。 such as <font>, <center>, ALink, align, width, height (for some elements) and background.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.