HTML specification and html encoding Specification

Source: Internet
Author: User

HTML specification and html encoding Specification

1. The document type is correct;

2. Use a lower-case element name, which looks fresh and easy to write;

3. Close each tag to be closed;

4. disable empty HTML elements, such as <meta/>;

5. the attribute name must be in lower case;

6. attribute values are enclosed in quotation marks;

7. Add the alt attribute to the image;

8. Avoid a line of code that is too long and should contain at least 80 characters;

9. Do not add blank lines for no reason;

10. Two spaces are recommended for indentation, but Tab is not recommended;

11.

12. The first character of multi-line comments is indented with two spaces, making it easier to read;

13. Style Sheet

(1) The curly braces are in the same line as the selector, and a space is added between them;

(2) Use two spaces to indent;

(3) Add a space between the colon and the attribute;

(4) quotation marks are used only when the attribute value contains spaces;

(5) place the right curly braces in a new row;

(6) each line can contain a maximum of 80 characters;

14. When loading js and style sheets, type is not required;

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.