The realization of Sprite diagram of moving side sprite

Source: Internet
Author: User

In the case of mobile adaptation, usually with REM as a long-width unit, so, under different devices, the actual width of the element (PX) is not the same, if it is a single picture as a background picture, the most convenient, as long as the background image set the properties background-size:contain| conver|100% can cover the entire div with a picture.

Second, if you use Sprite chart, then you have to change the size and position of the background image to REM units. background-position:x.x rem y.y Rem;background-size:xxrem Yyrem; This is to convert the PX of the design to REM. The principle is the size of the background image, as well as the display of the background image position with REM to the relative change, you can correctly display the corresponding icon.

The realization of Sprite diagram of moving side sprite

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.