Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
744 views
in Technique[技术] by (71.8m points)

移动端雪碧图background-position 用rem对不准位置 除了sass还有什么好的解决方案嘛

移动端雪碧图background-position 用rem对不准位置 除了sass还有什么好的解决方案嘛


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

设置 background-position 的同时还需要设置 background-size , 将单位都转换为 rem , 可以准确的显示出图标,不会出现对不准的情况。
一个demo,可以看下。
http://runjs.cn/detail/dsogyyi5


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...