CSS Sprite : Unable to show a section of img from a collection of images

标签 css sprite

我无法从图像集合中获取我想要的图像部分。 我从 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">

This is how the image appears while loading the page

最佳答案

我发现了我犯的错误。我已经映射了两次背景图像。 设计 img 标签时的一个。另一个通过它的类 [search_img1]

关于CSS Sprite : Unable to show a section of img from a collection of images,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30931377/

相关文章:

html - 使 div 的高度为视口(viewport)高度的 100% 或页面的整个高度

css - 如何在 React Native 中使用 vw 和 vh css

javascript - Vuetify - 数量巨大的 v-badge

java - 有谁知道任何 Sprite Collection ?

css - 如何为放大的放大背景 Sprite 设置 1px 边框和 1px 轮廓?

使用悬停+单击图像 Sprite 的 JQuery 导航菜单

jquery - fullcalendar - 动态改变行高

html - css 文本背景对于文本行之间的空间不同

unity3d - 在 Unity (2D) 中连接具有不同纹理的 Rule-Tiles

python - 在 pygame 中查找 Sprite