CSS Sprite stuff.

Source: Internet
Author: User
CSS Sprite is CSS sprites, others call it CSS Sprite, is a kind of CSS image merging technology, the method is to combine small icons and background image on a picture, and then use the background of CSS to display the image needs to display the part. The basic principle of CSS Sprite is to integrate some of the images you use on your site into a single image, reducing the number of HTTP requests on your site. This image is rendered using CSS background and background-position properties, which means your tags are more complex, and the images are defined in CSS rather than tags. Examples of implementation effects:

div {
width:25px;
height:25px;
Background-image:url (img/568dfdbdn4f7d7ca3.png);
Overflow:hidden;
}

p {
width:25px;
height:25px;
Background-image:url (img/568dfdbdn4f7d7ca3.png);
Background-repeat:no-repeat;
background-position:0px-25px;
Overflow:hidden;
}
<body>
<div></div>
<p></p>
</body>

is to set the height of the image display, will be more than a portion of the height of hidden, as well as set the display location of the picture, to adjust the display of the small icon;

How to generate CSS Sprite chart: http://spritegen.website-performance.org/

CSS Sprite stuff.

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.