我有一个我正在使用的 Sprite 图像,并且看到其他网站在他们的图像中实现了除数。我不明白这是什么意思。例如:
background: #fff url("/css/sprite.png") no-repeat scroll -107px -55px / 167px padding-box border-box;
“167px”是什么意思?
最佳答案
167px 是背景尺寸。
有关完整说明,请查看 this .
但为了浏览器兼容性,我建议您使用手写语法。我在 safari 浏览器中遇到过这种语法的问题。但是使用长手写语法效果很好:
background-position: -107px -55px;
background-size: 167px;
关于css - Sprite 图像中的除数是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36416808/