繁体   English   中英

使用CSS3将图像中的颜色替换为另一种颜色

[英]Replace a color with another color in an image with CSS3

您可以在CSS3中将一种颜色替换为另一种颜色吗?

在此处输入图片说明 在此处输入图片说明

通过一些技巧,您可以轻松地做到这一点。 只需打开图像的内部,透明然后

在此处输入图片说明

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

在末尾 在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM