E
E
Emptyform2016-01-19 09:48:21
css
Emptyform, 2016-01-19 09:48:21

How to scale icon from SVG sprite displayed in background?

Packed all my SVG icons into one sprite. I want to display one of the icons in backgrounda size smaller than in the SVG itself, but it does not work.
The only thing that worked was to output as output, and then apply Like transform: scale();
this:

.my-div:before {
    content: '';
    position: absolute;
    left: 5px;
    top: 5px;
    height: 72px;
    width: 72px;
    background-image: url('../img/icons.svg');
    background-repeat: no-repeat;
    background-position: 0 -397px;
    transform: scale(0.52);
  }

But I think this is complete bullshit.
What do you think? How to do it right?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rad1calDreamer, 2016-01-19
@Emptyform

Block size + background-size

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question