[Vuejs]-Not displayed background image

0👍

Your background image’s size is larger.
Add background-size: cover; property

0👍

I think your issue is that you are missing the height css attribute. Assuming that this is a block element, you would need that in addition to the width. Otherwise, your element would have 0 height, effectively meaning that none of the background would show.

.b-icon#historyDoc {
  background: url("../assets/history.png") center;
  background-size: contain;
  height: 32px;
  width: 32px;
}

If this is an inline element, you may need to add display: block; as well.

Leave a comment