2015-03-03 78 views

回答

0

您需要使用具有透明背景的png - 您使用的背景爲白色背景。例如。

.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>

如果你做單選按鈕png格式,你應該能夠找到一個比我使用了一個更好的一個(像我有一些粗糙的邊緣被顯示出來)搜索

+0

從哪裏獲取透明圖標? – Pindakaas 2015-03-04 11:31:36

+0

我通常會[google單選按鈕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 = _)並選擇一個我喜歡的,然後右鍵單擊並另存爲 – Pete 2015-03-04 11:54:32

0

是否有可能通過css改變這個?

號如果圖像有一定的透明度,你可以改變background-color(和/或background-image)其父元素,像這樣:

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

並在CSS:

.thing { 
    background-color: aqua; 
    /* This will show through the transparent region of the image */ 
}