How can we efficiently perform CSS encoding?

Source: Internet
Author: User

In the previous article, we mentioned the software used to compile CSS files. Today, let's look at some introductions: how can we efficiently perform CSS encoding?
What software should I use for CSS webpage layout development?

One of the advantages of CSS is that it can reduce the page size and shorten the download time, not only the loading of the homepage, but also after the style sheet is cached, the loading of subsequent pages is also accelerated. This is true, but the shortening of the loading time on the homepage is almost invisible because the CSS code is too long.
Okay, now everything is different. Learn how to use CSS coding efficiently so that you can minimize the size of the style sheet. Naturally, you may not see any amazing changes, but small bytes are also important for large websites.
There are many ways to reduce the code length, including shorthand properties, multiple declarations, default values, and inheritance ), and white space ).
Note attributes
Zeroing page margins mentioned a set of such note attributes, but there are more.
Note attributes include:
Font (control "font-size", "font-weight", "line-height", etc.) background (control the background, placement location, repeat times, and so on of elements)
List-style (set the attribute of the "origin" at the front of the list element)
Margin (defines the width of the margin (margin) on each side of the box)
Border (defines the attributes of the box boundary (border), including many tracing attributes related to the boundary) padding (defines the width of the padding on each side of the box)
The above project is linked to the relevant chapter of W3C CSS 2 specification.
For example, the font attribute is used to set the simple attributes of font-style, font-variant, font-weight, font-size, line-height, and font-family at the same time. Of course, not all of them must be written in the simplified attributes. Once a certain attribute is ignored in the summary attribute, all missing attributes will be set as their initial values, as mentioned in the font property section in W3C standards. To control many font-related attributes, you can use this note attribute to save a large number of bytes in the style sheet.

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.