我有这样的精灵:
并使用以下css显示:
.sprite { background: url('sprite.png') no-repeat top left; width: 40px; height: 40px; }
.sprite.Live { background-position: 0px 0px; }
.sprite.Private { background-position: -50px 0px; }
.sprite.Public { background-position: -100px 0px; }
但图像周围总是有边框。我确保设置了img {border:0}。我正在使用Bootstrap 3.这是由bootstrap引起的吗?
答案 0 :(得分:1)
事实证明它的Chrome问题。这是我能找到的最接近的答案。
It's because you are using an img tag with no src attribute. Chrome is essentially indicating the size of the container with nothing in it.