1 回答

TA貢獻1796條經驗 獲得超4個贊
您可以嘗試使用過濾器
.red {
color: red;
background-color: yellow;
}
.red > span {
filter: hue-rotate(180deg) saturate(10);
}
<span class="red">DROPLET <span>??</span></span>
或者 mix-blend-mode 但這也會影響背景:
.red {
background:#fff;
position:relative;
display:inline-block;
}
.red > span {
filter:brightness(0); /* We make the icon black */
}
.red:before {
content:"";
position:absolute;
top:0;
left:0;
right:0;
bottom:0;
background:red;
pointer-events:none;
mix-blend-mode:lighten; /* this will make the icon red since red is more "light" than black*/
z-index: 1;
}
<span class="red">DROPLET <span>??</span></span>
添加回答
舉報