I
I
Islam Ibakaev2019-04-09 18:45:21
css
Islam Ibakaev, 2019-04-09 18:45:21

What's wrong with this sprite?

Something doesn't work with the sprite
Trying to pick up the background-position - nothing is visible

.icon {
  background-repeat: no-repeat;
  background-image: url('http://krona.mosco-web.ru/sprite.svg');
  background-size: 700px 194px;
  display: inline-block;
}

.icon--hamburger {
  background-position: 0 0;
  width: 21px;
  height: 17px;
}

<i class="icon icon--hamburger"></i>

sandbox - https://codepen.io/dagman/pen/EJZXzX

Maybe the designer didn't form the sprite correctly?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
RAX7, 2019-04-09
@devellopah

invalid background-position
https://codepen.io/anon/pen/MRJENd

T
tyzberd, 2019-04-09
@tyzberd

svg sprites are used wrong.
https://css-tricks.com/svg-symbol-good-choice-icons/
in use xlink:href="#shape-icon-1" specify a link to the sprite with id

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question