CSS uses the Background-position property to complete the code of the sprite diagram

Source: Internet
Author: User
What is sprite diagram?

Sprite is a CSS sprite, some call it CSS Wizard, is a CSS image merging technology, is to combine a number of small icons into a picture, and then use the CSS background-position to display the need to display the part.

Why use Sprite chart?

It can reduce the number of requests to the server when loading webpage picture, improve the loading speed of the page, and solve the phenomenon of flashing white when the IE6 mouse is out of date.

What's the downside of using sprite charts?

Personally think if your sprite is not very large, it is not very complex basic no drawbacks. If your sprite is large and complex, there will be CSS code review, Web pages account for a wide range of problems such as memory.

Instance

It's a button, and the second is what it looks like when the mouse passes.

Here are two small icons that have been synthesized by a sprite chart

Personal Center
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.