1
如何在compas sass中生成諸如「right -300px」的精靈位置?
我發現sass只能輸出數字中的背景位置,但有時我需要將精靈位置對齊或對齊,怎麼做?
請看看我的代碼波紋管:如何在compas sass中生成諸如「right -300px」的精靈位置?
<style type="text/css">
/* ------- scss ------- */
$map_btn: sprite-map("sprite_btn/*.png");
.btn,.btn span{
display:inline-block;
background-image: sprite-url($map_btn);
background-repeat: no-repeat;
}
.go_to_cart{
background-position: sprite-position($map_btn,go_to_cart);
span{
background-position: sprite-position($map_btn,go_to_cart);
}
}
/* ------- output ------- */
.btn,.btn span{
display:inline-block;
background-image: url('../images/btn_sprite.png');
background-repeat: no-repeat;
}
.go_to_cart{
background-position: 0 -300px;
}
.go_to_cart span{
background-position: 0 -330px;
/* -------
but I want to output like this bellow:
how to write in scss?
------- */
background-position: right -330px;
}
</style>
<a href="#" class="btn go_to_cart">
<span></span>
</a>
爲什麼沒有人回答 – linjuming