我試圖webfilters改變這一形象的白色背景上的:我該如何改變這張圖片的背景?
Change color of PNG image via CSS?
不知道這是改變這一形象的whitebackground方式:
http://i.stack.imgur.com/AZRrE.png
是否有可能通過CSS來改變它?
我試圖webfilters改變這一形象的白色背景上的:我該如何改變這張圖片的背景?
Change color of PNG image via CSS?
不知道這是改變這一形象的whitebackground方式:
http://i.stack.imgur.com/AZRrE.png
是否有可能通過CSS來改變它?
您需要使用具有透明背景的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格式,你應該能夠找到一個比我使用了一個更好的一個(像我有一些粗糙的邊緣被顯示出來)搜索
是否有可能通過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 */
}
該圖像沒有透明度...(從其他問題開始引用:「給定一個透明的PNG ...」) – gvee 2015-03-03 11:02:31