0
In my code (transparent text)mix-blend-mode doesn't work.why?
18 Answers
+ 4
Add
body {
margin: 0;
https://code.sololearn.com/WUdbOx55JJyG/?ref=app
+ 4
Wow! 👏👏, 👏👏👏👏
+ 3
NISHA QURESHI
Can you see the mix-blend-mode effect in this code?
https://code.sololearn.com/WB80fnrrKMNC/?ref=app
+ 3
You need a parent div instead of body
https://code.sololearn.com/WiPb30p7919J/?ref=app
+ 3
Parent
QUOTE FROM MDN:
The mix-blend-mode CSS property sets how an element's content should blend with the content of the element's parent and the element's background.
UNQUOTE
+ 3
It can be p or something else except body, just for containing your h2
+ 3
I'm not familiar with mix-blend-mode. But it seems that the background layer need to have a underneath white layer in order to blend with the text.
Try to put
html {
background-color: white;
}
Edit:
I found the solution from stackflow
Add this css
html { background: white; display: flex; height: 100%; }
https://stackoverflow.com/questions/43503755/did-chrome-safari-recently-change-the-way-mix-blend-mode-is-handled
+ 3
+ 3
html{
Background-color:white;
display: flex;
min-height: 100%;
}
https://code.sololearn.com/WUdbOx55JJyG/?ref=app
+ 2
Learner
Her code is this :
https://code.sololearn.com/WcvRZ2j78c7t/?ref=app
NISHA QURESHI
Demo of mix-blend-mode :
https://code.sololearn.com/WB80fnrrKMNC/?ref=app
If you cannot see mix-blend-mode also in this demo, it's Compatibility
https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode
Are you running the code in computer or in mobile app?
What version of browser are you using?
+ 2
But just in case I am wrong, I better invite a knowledgeable sololearners to explain this.
Can you help us, Calviղ ?
+ 2
Is there any way to remove the white surrounding?
+ 1
No,This is not my answer.I just want to know that why my code doesn't support mix-blend-mode property
+ 1
Yes
+ 1
Why div is added
Is it not possible without div element?