是否可以在背景中使用svg图像作为精灵图像?

时间:2020-04-09 07:43:26

标签: html css svg css-sprites

是否可以在背景中使用svg图像作为精灵图像,如以下代码所示。以下代码可用于png精灵图片,但希望将其用于svg图片。任何人都有关于我们如何进行操作的意见,以及它是否将在不同的浏览器上支持?

示例:

.background-star {
  background: transparent url(../../../images/web/icons/sprite1.svg) no-repeat;
  width: 80px;
  height: 80px;
}

.background-star.position-1 {
    background-position: 0 0;
}
.background-star.position-2 {
    background-position: 20px 0;
}
.background-star.position-3 {
    background-position: 40px 0;
}

etc so, that different parts of the image can be accessed?

0 个答案:

没有答案