2

screenshot of phone inspect mode.I used mix-blend-mode css property in my code. It is working on chrome desktop browser but not working on my phone chrome browser. I have used mix-blend-mode: screen; property for div fire1,fire2,fire3 images. What am I doing wrong? Please Help ! Thank you! [tag:mix-blend-mode:screen]

I have tried this:



        body {
            background: url("https://i.postimg.cc/RF34x0dJ/Pngtree-red-glitter-pattern-indian-diwali-1447745.png");
            background-size: 100% 100%;
            background-repeat: no-repeat;
            background-attachment: fixed;
        }

        .fire1 img {
            position: absolute;
            mix-blend-mode: screen;
            top: 10px; 
            height: 200px;
            width: 200px;

        }
        .fire2 img {
            position: absolute;
            top: 10px;
            mix-blend-mode: screen;
            height: 200px;
            width: 200px;

        }
        .fire3 img {    
            position: absolute;
            top: 155px;
            mix-blend-mode: lighten;
            height: 368px;
            width: 368px;
        }

        

        .fire1 {
            display: flex;
            justify-content: right;

        }

        .fire2 {
            
            display: flex;
            justify-content: left;

        }

        .fire3 {
            display: flex;
            justify-content: center;

        }
        <div class="fire1">
            <img src="https://ik.imagekit.io/souravkumar8409/bluefirework1.gif?ik-sdk-version=javascript-1.4.3&updatedAt=1672739568223"
                alt="fire">
        </div>

        <div class="fire2">
            <img src="https://ik.imagekit.io/souravkumar8409/bluefirework1.gif?ik-sdk-version=javascript-1.4.3&updatedAt=1672739568223"
                alt="fire">
        </div>

        <div class="fire3">
            <img style="mix-blend-mode: screen;" src="https://ik.imagekit.io/souravkumar8409/fireworkbig.gif?ik-sdk-version=javascript-1.4.3&updatedAt=1672739568765"
                alt="fire">
        </div>

2 Answers2

2

I had the very same issue and it seems that the problem has to do with the body element holding the background you want to use the mix-blend-mode on to.

I would suggest you to try this:

  1. Remove all background elements from body
  2. create new background class :
.bg {
    position: fixed;
    /*define the size and position you need*/
    width: 100vw;
    height: 100vh;
    background: url("https://i.postimg.cc/RF34x0dJ/Pngtree-red-glitter-pattern-indian-diwali-1447745.png");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-attachment: fixed;
    z-index: -1;
}
<body>
    <div class="bg"></div>
    <div class="fire1">
        <img src="yourImage.jpg" />
    </div>

    <!-- OR -->

    <div class="bg">
        <div class="fire1">
            <img src="yourImage.jpg" />
        </div>
    </div>
</body>

If needed you can place .fire as well inside the .bg, I tested both, and both ways work.

0

make sure you're using a compatibility brownser on phone

https://caniuse.com/?search=mix-blend-mode

Partial in Safari refers to not supporting the hue, saturation, color, and luminosity blend modes.

fabiovaz
  • 516
  • 2
  • 9