Web Front-end optimization> CSS Optimization

Source: Internet
Author: User

SeeArticle: Writing efficient CSS

1. Place CSS inCodePut stylesheets at the top)

I think the official explanation is a bit vague. This actually correspondsUser Access expectation. CSS is placed at the top, and the browser can parse and render HTML pages from top to bottom. No one like to wait, and the browser has taken this into consideration.

2. Avoid CSS expressions (avoid CSS expressions)

I personally think that things that can be done through CSS expressions can also be done through other means and the risk is lower.

3. Strip JavaScript and CSS (make JavaScript and CSS external) from the page)

After divestiture, it can be individually processed, such as compression or cache policies.

4. Simplified JavaScript and CSS (Minify JavaScript and CSS)

It may be better without JavaScript or CSS. However, this is not possible. So, try to be smaller. The short syntax can be abbreviated.

5. Use <link> instead of @ importchoose <link> over @ import

In ie, the @ import command is equivalent to the link mark written at the bottom of HTML. This is against the first article.

6. Avoid using filter (avoid filters)

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.