Is it possible to use an svg image as a sprite image in background?

110 Views Asked by At

Is it possible to use a svg image as a sprite image in background, as shown in the below code. The below code works with a png sprite image but would want to use it with an svg image. Anybody has inputs as to how we go about it and if will it support on different browsers?

Example :

.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

There are 0 best solutions below