M
M
malcore_hardcore9682016-10-01 15:53:54
css
malcore_hardcore968, 2016-10-01 15:53:54

How to set a background for an svg image? How to apply z-index to ::before and ::after?

There is an svg icon, you need to set a red background. The svg itself is loaded via CSS. Question: How can I set a background for this svg image? I tried to set the z-index, it does not work ...

.owl-prev, .owl-next
  position: absolute
  z-index: 3
  top: 50%
  border-radius: 25px
  height: 18px
  width: 18px
  margin: 11px 35px
  background-image: url("../img/favicon/arrow-slide.svg")
  background-size: contain

    &::before
      content: ""
      position: absolute
      z-index: 2
      background: #000
      width: 48px
      height: 48px

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg, 2016-10-01
@malcore_hardcore968

Isn't it easier to write fill in svg: #fff;

_
_ _, 2016-10-01
@AMar4enko

And what's the problem with setting background-color along with svg?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question