Front-end specifications (I)

Source: Internet
Author: User

1. All letters are written in lower case.

2. ID and class must start with a letter

3. All labels must be closed

E.g. <p> </P>

4. indent HTML tags with the tab key. Pay attention to the Code to facilitate self-check and viewing by others.

5. attribute values must be enclosed in quotation marks.

E.g. <span id = "hello"> </span>

6. html comments

<! -- Use on the left <! --, Use --> on the right. There must be a space gap between the comment content and the symbol --> <! -- <Div> <p> Hello World ~~~ </P> </div> -->

 

[Note] a space between the comment content and the comment symbol must exist. If it is omitted, it is mistaken that all of the following are comments.

7. CSS comments

// When the line comment uses a two-slash, a space is added between the slash and the comment content //. NAV {width: 960px; Height: 70px; margin: 0 auto ;}//. content {width: 500px; Height: 500px; float: Left ;}//. sidebar {width: 460px; Height: 400px; margin: 0 autofloat: Right ;}

 

8. Div cannot be nested in tags with parent-child relationships in UL Li ol Li dl dt dd.

Cause: an error occurs in JS. It is found in the form of a node. If a div is inserted, it cannot be found.

The following code is incorrect:

<ul>    <li></li>    <div></div> </ul>

9. Fast attribute labels cannot be nested in p dt h labels.

Reason: block tags cannot be contained

10. A labels cannot be nested

11. inline elements cannot be nested with block-level elements (this specification only exists in W3C specifications)

12. inline elements do not support width and height. If you want inline elements to support width and height, you can use display: block or display: inline-block;

  

Front-end specifications (I)

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.