CSS Sprites (CSS genie) Application

Source: Internet
Author: User

The key to acceleration is not to reduce the weight, but to reduce the number. If the weight is less than kb, as long as the network is not particularly slow, the efficiency is almost the same. However, if the number of images is doubled, the efficiency will be significantly lower.

Traditional cut-down images are fine-grained. The smaller the image type, the better the weight, and the better. In fact, the size of the cut-down images does not matter, and the computers are all computed in bytes. Each time the client displays an image, a request is sent to the server. Therefore, the more images are requested, the higher the latency. Because the transmission time of an image is usually far less than the request wait time.

Three Tips for image reduction (CSS Sprite ):

1. Image Slicing)

For example, in a text editor, there are many small icons. It is difficult for users to open a text editor. If you use a picture to solve the problem, this will not happen, such as Baidu space, 163 blog, and Gmail.

Image Slicing's Kiss of Death
Http://www.alistapart.com/articles/sprites

2. Single-image rolovers)

The traditional scheme needs to request a new image because of network problems. If you combine multiple states into a single image, you can solve the problem perfectly, and then use the background image technology to simulate the dynamic effect.

ColorScheme Ratings
Http://demo.rexsong.com/200608/colorscheme_ratings/

3. Extend Background Image)

If a side of an image can be tiled and extended without any restrictions, you do not need to create a single corner or edge. You can have only one image. In fact, this theory can also be extended to the four-corner container. The advantage is that it can greatly simplify the HTML Structure.

Extend Background Image
Http://demo.rexsong.com/200705/extend_background_image/

Comprehensive Cases

Google Korea (Skills 1 and 2)
Http://demo.rexsong.com/200705/google_korea/

CSS Menus (2 and 3 Tips)
Http://demo.rexsong.com/200705/css_background_menus/

 

Original: http://blog.rexsong.com /? P = 746

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.