Six optimization techniques using CSS

Source: Internet
Author: User

1. Put stylesheets at the top (put CSS at the top of the code page)

CSS is placed at the top, and the browser can parse and render HTML pages from top to bottom.

Ii. 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. Make JavaScript and CSS external (strip JavaScript and CSS from the page)

After JavaScript and CSS are stripped off, they can be individually processed, such as compression or cache policies.

4. Minify JavaScript and CSS (simplified 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. Choose <link> over @ import (use <link> instead of @ import)

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

Vi. Avoid Filters

Avoid using filters, which is good for websites, especially browsers.

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.