-2

I tried webfilters to change the white background of this image looking at this:

Change color of PNG image via CSS?

Not sure if this is the way to change the whitebackground of this image:

radiobutton

https://i.stack.imgur.com/AZRrE.png

Is it possible to change this through css?

Community
  • 1
  • 1
Pindakaas
  • 4,389
  • 16
  • 48
  • 83
  • 3
    That image has no transparency... (opening quote from other question: "Given a transparent PNG...") – gvee Mar 03 '15 at 11:02

2 Answers2

0

You need to use a png that has a transparent background - the one you are using has a white background. For example.

.red {background-color:red;}
.blue {background-color:blue;}
.green {background-color:green;}
<div class="red"><img src="http://i.imgur.com/UAdT2Jd.png" /></div>
<div class="blue"><img src="http://i.imgur.com/UAdT2Jd.png" /></div>
<div class="green"><img src="http://i.imgur.com/UAdT2Jd.png" /></div>

If you do a search for radio button png you should be able to find a better one than the one I have used (as mine has some rough edges that are showing up)

Pete
  • 57,112
  • 28
  • 117
  • 166
  • where to get the transparent icons from? – Pindakaas Mar 04 '15 at 11:31
  • I usually [google radio button png](https://www.google.co.uk/search?q=radio+button+png&safe=active&bih=1032&espv=2&biw=1920&tbm=isch&tbo=u&source=univ&sa=X&ei=MPL2VOrFH6Xm7gacgYGwAg&ved=0CCAQsAQ#imgdii=_) and choose one I like then right click and save as – Pete Mar 04 '15 at 11:54
0

Is it possible to change this through css?

No. If the image had some transparency, you could change the background-color (and/or background-image) of its parent element, like so:

<span class="thing"><img src="your-semi-transparent-image.png"></span>

And in the CSS:

.thing {
  background-color: aqua; 
  /* This will show through the transparent region of the image */
}
Olly Hodgson
  • 15,076
  • 3
  • 40
  • 60