调整来自精灵的图像大小 [英] Resize images from sprite
本文介绍了调整来自精灵的图像大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以调整我们从sprite收到的图片的大小。
我的意思是这样的:
background:url(../ images / sprite.png)no-repeat - 1px -1170px;
display:block;
height:14px;
width:14px;
是否可以通过sprite更改宽度和高度?例如,如果我在分辨率为40x40的精灵中有铅笔图标,但我想显示像20x20像素这样的铅笔图标
$ b解决方案
您可以在css3中使用 background-size
属性:
background-size:50%50%;
Is it possible to resize images which we receive from sprite. I mean like this:
background: url(../images/sprite.png) no-repeat -1px -1170px;
display: block;
height: 14px;
width: 14px;
Is it possible to change width and height from sprite? For example if I have pencil icon in sprite with resolution 40x40 but I want to display this pencil icon like 20x20 pixels
Thank you, in advance.
解决方案
You can use the background-size
property in css3:
background-size: 50% 50%;
这篇关于调整来自精灵的图像大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文