Adrian Simionescu
Adrian Simionescu

Reputation: 145

Replace a color with another color in an image with CSS3

You can replace one color with another in CSS3?

enter image description here enter image description here

Upvotes: 0

Views: 278

Answers (1)

Shayan
Shayan

Reputation: 966

by a little tricks you can do this easily . just turn the inside of image ,transparent and then

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>

and

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

at the end enter image description here

Upvotes: 3

Related Questions