CSS Tutorials: We recommend over 20 tips

Source: Internet
Author: User

  Fire Station Building Institute (Bkjia.com) CSS tutorialThree years ago, you may not know what CSS is. Today, three years later, you mentioned CSS. As a webmaster, if you don't even know its name, it is a very unsuccessful webmaster. In the early days, most of the web page creation was controlled by TABLE tables, and the webpage framework was too dead and redundant code. Therefore, it was gradually replaced by a very flexible cascade style (CSS, in the CSS tutorial of the School of building a website in the fire, we will send some CSS tutorials while providing some CSS tips. The following are more than 20 tips carefully compiled by Alibaba Cloud. I hope this will help you.

The hexadecimal color code abbreviation of CSS. 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.

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.

Do not use a small image to tile the background. 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.

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.

Put the style on the head, and put the script under your feet. Not embedded, only external links.

Do not use CSS expressions.

Use reference style sheets instead of importing them through @ import.

In general, PNG is much smaller than GIF. In addition, the number of colors in GIF images is wasted, which deserves optimization.

Do not zoom in or zoom in the image in HTML. One is hard to see and the two occupy resources.

It is best to use an even number of text fonts, such as 12px, 14px, and 16px. Special case: 15px.

Block, ul, ol and so on are set to at least one time between the upper and lower line spacing, at least two times on the left side of the line spacing, right side random. There must be at least one line spacing between paragraphs.

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.

All Chinese Punctuation Marks. English inclusion in Chinese text, left and right spaces, halfwidth.

The bold and italic characters in Chinese fonts are better away from each other.

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.