0

I compare all images in sprite and don`t decide which option is better:

<img src="./img/sprite.png" height="63" width="193" class="sprite-class" alt="">

.sprite-class {
  object-fit: none;
  object-position: -440px -315px;
  font-family: 'object-fit: none; object-position: -440px -315px;';
  height: 63px;
  width: 193px
}

and a bit js code for IE

and second option:

<div class="sprite-class"></div>

.sprite-class {
background-position: -494px -20px;
width: 63px;
height: 193px;
background: url(./img/sprite.png) 0px 0px no-repeat;
margin: 0 auto;}

Last works in IE without js, but is it good use div for show logo and other images? Thanks for your answers!

Medvedev A.
  • 305
  • 2
  • 11

1 Answers1

0

No, for showing a logo you should not use background image. This post might be helpful for you, When to use IMG vs. CSS background-image?

Community
  • 1
  • 1
manian
  • 1,418
  • 2
  • 16
  • 32