问题
I want to achieve some text that sits on top of an image and using mix-blend-mode: color-dodge
to make the text looks better.
Here is the example: https://codepen.io/pizza0502/pen/KepWGM
It works perfectly in Chrome and Firefox, but in Safari, the text that is not on top of the image will become white...any solution on this?
回答1:
Wrap your items in a container, isolate the container, and don't absolutely position your h1
.
div {
isolation: isolate;
}
h1 {
font-size: 10rem;
color: #fb4b6b;
mix-blend-mode: color-dodge;
}
img {
position: absolute;
top: 200px;
z-index: -1;
}
<div>
<h1>Hello Mix Blend Mode</h1>
<img src="https://source.unsplash.com/random"/>
</div>
来源:https://stackoverflow.com/questions/50628725/how-to-fix-safari-mix-blend-mode-color-dodge-bug