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.