A good habit of writing html+css

Source: Internet
Author: User

1. use a tag with semantics

2. Create a good tag

a) Choose the right DOCTYPE, which is required for a robust document

b) Specify the language and character set, and some search engines filter results based on the language of the search request

c) Specify a title, whether a collection or search engine has a preference for the content in the title

d) Choose the right elements

e) Avoid excessive use of div and span

f) use the label as little as possible

g) use class and ID appropriately

3. CSS

a) When you create and test a CSS , first in the most advanced, state-of-the-art browsers, and then consider other browsers

b) If you are using a float to implement the layout, make sure the float is correct

c) try to slightly reduce the percentage value because the browser sometimes calculates that 50%+50% may be equal to 100.1%, so you can try to 50% instead 49% .

d) Link visited hover Active (Love-hate principle)

e) test development uses an embedded style that changes to an external style when publishing

1. use a tag with semantics

2. Create a good tag

a) Choose the right DOCTYPE, which is required for a robust document

b) Specify the language and character set, and some search engines filter results based on the language of the search request

c) Specify a title, whether a collection or search engine has a preference for the content in the title

d) Choose the right elements

e) Avoid excessive use of div and span

f) use the label as little as possible

g) use class and ID appropriately

3. CSS

a) When you create and test a CSS , first in the most advanced, state-of-the-art browsers, and then consider other browsers

b) If you are using a float to implement the layout, make sure the float is correct

c) try to slightly reduce the percentage value because the browser sometimes calculates that 50%+50% may be equal to 100.1%, so you can try to 50% instead 49% .

d) Link visited hover Active (Love-hate principle)

e) test development uses an embedded style that changes to an external style when publishing

A good habit of writing html+css

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.