Use background image code and background image code

Source: Internet
Author: User

Use background image code and background image code

<Button class = "u-btn"> click me </button>
. U-btn {background: url (images/btn.png) no-repeat 0 0 ;}. u-btn {background: url (images/sprite.png) no-repeat 0-50px ;}

 

Merge Images

What is a Sprite puzzle:

 

Benefits of Sprite:

Reduces network requests and increases webpage loading speeds

 

 

 

Image optimization and merging

Balance and trade-offs

 

Compression Tool

-Lossless Minimage

-Lossy TinyPng

 

Merge-arrange

Gaps must be retained between images

Picture Arrangement

-Horizontal arrangement

-Vertical arrangement

 

Merge-category

Merge images of the same module

Merge images of similar sizes

Merge images with similar colors

Merge the above methods

 

Merge recommendations

Merge images used on this page only

Stateful icon Merging

 

 

Browser compatibility Solution

-IE6 does not support PNG24 translucent (store 2 copies: sprite.png 24 sprite_ie.png 8)

-CSS3 & Cropping

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.