2016-03-04 72 views

回答

3

一个小动作,你可以很容易地做到这一点。只是把图像内的,透明的,然后

enter image description here

<style type="text/css"> 
.bx{ 
    width: 73px; 
    height: 73px; 
    background: transparent url("top.png") no-repeat; 
} 
.bx.yellow{background-color: yellow} 
.bx.green{background-color: green} 
</style> 

<div class="bx"></div> 
<div class="bx yellow"></div> 
<div class="bx green"></div> 

enter image description here

+0

很好,但我有一个更复杂的图像,更多的颜色可以改变。 –

+1

@AdrianSimionescu对于这种类型的东西通常只适用于图像。对于绿色和黄色,只需使用绿色和黄色图像,并通过用户操作加载它们 – Shayan

相关问题