Html css coding specifications (Golden law) and css golden Law

Source: Internet
Author: User

Html css coding specifications (Golden law) and css golden Law
HTML syntax

  • Use two spaces to replace tabs-this is the only way to ensure consistent display in all environments.
  • The nested element should be indented once (that is, two spaces ).
  • For attribute definitions, make sure that all double quotation marks are used. Do not use single quotation marks.
  • Do not add a slash to the end of the self-closing element-this is optional in the HTML5 specification.
  • Do not omit the optional ending tag (for example,</Li>Or</Body>).
<! DOCTYPE html> 
HTML5 doctype

Add a standard mode statement to the first line of each HTML page to ensure consistent display in each browser.

<! DOCTYPE html> 
Language attributes

According to HTML5 specifications:

We strongly recommend that you specify the lang attribute for the html root element to set the correct language for the document. This will help the speech synthesis tool determine the pronunciation it should adopt and help the translation tool determine the rules it should follow during translation.

Related Article

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.