15 common CSS knowledge that DIV + CSS experts can also read

Source: Internet
Author: User

1. Do not use a small image for background tile. This is why many people do not need 1px. Images with a width of 1 px and a height of 200 PX are tiled out, which requires 200*40,000 = times to occupy resources.
2. No border. The recommended method is border: none;. Haha, I have been using this. Border: 0; only defines that the Border width is zero, but the border style and color will still be parsed by the browser, occupying resources.
3. Use the * wildcard with caution. The so-called wildcard character is to initialize all the labels in CSS, regardless of the unused, outdated, and advanced. In this way, resources are greatly occupied. You must have the selected initialization tag.
4. hexadecimal color of CSSCodeAbbreviation. I am used to abbreviations and lower-case letters, so I know that it was not recommended, in order to reduce the resources occupied by parsing. But it also increases the file size. The advantage is superior and the disadvantage is to be carefully verified.
5. Put the style on your head and the script on your feet. Not embedded, only external links.
6. Do not use CSS expressions.
7. Use a reference style sheet instead of importing it through @ import.
8. Generally, PNG is much smaller than GIF. In addition, the number of colors in GIF images is wasted, which deserves optimization.
9. Do not zoom in or zoom in the image in HTML. If one is not easy to see, the two occupy resources.
10. It is best to use an even number of text fonts, such as 12px, 14px, and 16px. Special case: 15px.
11. Block, UL, ol, and so on are set to at least one time between the upper and lower lines, and at least two times the line between the left and the right.
12. There must be at least one line spacing between paragraphs.
13. Forcibly specify the line-height of some elements. The body is 1.6 times larger than the text size and the title is 1.3 times.
14. full-width Chinese punctuation. English inclusion in Chinese text, left and right spaces, halfwidth.
15. The bold and italic characters in Chinese fonts are better away from each other and benefit the people themselves.

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.