CSS Beginner's tips for using CSS

Source: Internet
Author: User
[Guide] 1, do not use too small pictures to do the background tile. That's why a lot of people don't use 1px, and that's why they know it. The picture of the width height 1px tile out a wide height 200px area, need 200*200=40, 000 times, occupy resource. 2, no border. The recommended wording is

1, do not use too small pictures to do the background tile. That's why a lot of people don't use 1px, and that's why they know it. The picture of the width height 1px tile out a wide height 200px area, need 200*200=40, 000 times, occupy resource.

2, no border. The recommended wording is border:none; haha, I've been using this. border:0; Just define the border width to zero, but the border style, color or will be resolved by the browser, occupy resources.

3. Use the * wildcard character with caution. The so-called wildcard, is the CSS all the tags are initialized, regardless of the use of the outdated advanced, non-discriminatory, so, greatly occupy resources. To have a selection of initialization tags.

4. Hexadecimal color code abbreviation for CSS. Accustomed to the abbreviation and lowercase, this only know that the original is not the recommended wording, in order to reduce the resources occupied by the resolution. But it also increases the file volume. The merits of the best are subject to careful textual examination.

5, style put on the head, script put foot. Not embedded, only outside the chain.

6, resolutely do not use the CSS expression.

7. Use a reference style sheet instead of importing by @import.

8. Generally speaking, PNG is smaller and much smaller than GIF. Furthermore, the number of colors in GIF is wasted and well worth optimizing.

9, do not scale the image in the HTML, accesses than either not good-looking, the two accounted for resources.

10, the body font is best used even, 12px, 14px, 16px, the effect is very good. Special case, 15px.

11, block, UL, OL and so on to set aside at least one times the spacing, left at least twice times the spacing, the right side arbitrarily.

12. Between paragraphs, there must be at least one double spacing.

13, forcibly specify certain elements of the line-height, the body 1.6 times times the size of the text, title 1.3 times times.

14, Chinese punctuation with full-width. English inclusion in Chinese, left and right space, half-width.

15, the Chinese font of bold and italic, far better, to the benefit of self-interest.

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.