Advantages, Disadvantages and Use of CSS Sprites_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:06:12
Original
1095 people have browsed it

Advantages


1. Reduce the http requests of web pages, greatly improving the performance of the page;
2. Reduce the words in pictures;
3. Solution To solve the problem of naming pictures, you only need to name a collection of pictures. There is no need to name every small element, thus improving the efficiency of web page production.
4. It is easy to change the style. You only need to modify the color or style of one or a few pictures, and the style of the entire web page can be changed. Maintenance is more convenient.


Disadvantages


1. When merging pictures, multiple pictures must be merged into one picture in an orderly and reasonable manner. Leave enough space to prevent unnecessary backgrounds in the section; these are okay, but the most painful thing is the adaptive page under widescreen and high-resolution screens. If your picture is not wide enough, it is easy for the background to break;
2. It is more troublesome during development. You have to measure and calculate the precise position of each background unit through photoshop or other tools. This is needlework, not difficult, but very complicated
3. It is more troublesome during maintenance. If there is a slight change in the page background, you usually need to change the merged image. It is best not to touch the parts that do not need to be changed, so as to avoid changing more css. If it cannot be placed in the original place, you can only (preferably) move it to Add a picture below, so the bytes of the picture will increase, and the css must be modified.
CSS Sprites are worth learning and applying, especially if the page has a bunch of icos (icons). In short, many times we have to weigh the pros and cons before deciding whether to use CSS Sprites.




Use


There are several articles about CSS Sprites, which basically explain its principles and mechanisms very well. clear.
What Are CSS Sprites?
How to create CSS sprites
Creating Rollover Effects with CSS Sprites
Building a Dynamic Banner with CSS Sprites
Content about CSS Sprites in High Performance Web Sites 3.2. CSS Sprites

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!