我在精神图像中有 10 个像素大小的图像我想将该图像用作此标题文本的背景我的 css 代码:
.header-text {
background:url(images/sp-images.jpg);
background-position-x: -0px;
background-position-y: -28px;
}
我的 html 代码:
<h1 class="header-text">let's Knockout Poverty in India!</h1>!
i want to apply that red shadow image as a background to the header text
最佳答案
CSS Sprite 不能在两个方向平铺。如果垂直堆叠 Sprite ,则可以水平平铺它们;如果将它们水平排列,则可以垂直平铺。
查看您的图像,它似乎在一个二乘二的网格中有四张图像。以这种方式设置,您将只能在非重复背景中使用这些 Sprite 。
关于jquery - CSS Sprite 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8338211/