I
I
Igor2015-11-08 19:43:20
css
Igor, 2015-11-08 19:43:20

How to replace image in img with css?

hDQrPF2.png

img.im_user_holder{
    background-image: url("https://pp.vk.me/c622125/v622125762/535f6/CCcKgoOW8OI.jpg");
    border-radius: 100px;
    width: 0px;
    height: 0px;
    
  }
  
  img.im_user_holder::before{
     background: url(https://pp.vk.me/c622125/v622125762/535f6/CCcKgoOW8OI.jpg) no-repeat;
    n
    width: 70px;
    height: 70px;
  }
  
  .im_photo_holder img{
    border-radius: 100px;
   
  }

it doesn't work...
only css can be used
thanks!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Wolf, 2015-11-08
@IgorBee

Yes, :after & :before pseudo-elements don't work with img. Therefore, you need to do this:

#im_user_holder img { opacity: 0 }
#im_user_holder { background: url('/url.png') no-repeat }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question