CSS - 多个图像合而为一并使用 CSS 确定背景
如果您不明白我的意思,请查看此图片:
我想知道它是如何工作的,CSS是的,但是当使用使用该图像的背景时,它到底是如何工作的,然后它完全按照它应该做的事情进行剪切 - 当确定为该图像的背景。
我很想知道如何做 - 这样我就可以把我的 CSS 水平提高一点 :P
谢谢
If you don't know what I mean, check this image out:
I want to know how it works, CSS yes, but exactly how does it all work out when using a background using this image and then it is all cut all exactly what it is supposed to do - when determined as a background for this image.
Would be interesting for me to know how - so I can take my CSS level up a bit more :P
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您正在寻找的是CSS Sprites,有大量的教程和方法可以实现这一点。基本上,您所做的就是声明背景并使用
background-position
来决定背景中显示的内容。顺便说一句,CSS Sprites 非常棒,对于尝试弄清楚它们来说是一件好事。
What you are looking for is CSS Sprites, there are heaps of tutorials and ways to achieve this. Basically what you are doing is declaring a background and using
background-position
to decide what in the background is displayed.CSS Sprites are great by the way, good job for trying to figure them out.