我无法从图像集合中获取我想要的图像部分。 我从 http://spritepad.wearekiss.com 生成了这个 CSS
.search_img1{
background: url(/images/FBImages/1.png) no-repeat;
width: 16px;
height: 16px;
}
.search_img1 {
background-position: -152.98749923706055px 0;
}
Img 标签是:
<img id="search" src="images/FBImages/1.png" class="search_img1" title="search" alt="Seach" autocomplete="off">
最佳答案
我发现了我犯的错误。我已经映射了两次背景图像。 设计 img 标签时的一个。另一个通过它的类 [search_img1]
关于CSS Sprite : Unable to show a section of img from a collection of images,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30931377/