CSS background image screen opacity and saturation with linear gradient [duplicate]

落爺英雄遲暮 提交于 2019-12-20 05:45:35

问题


So i have a landing page design with includes an image, a gradient and a full page grid. I want to have the following:

A background to my landing page (a grid) that consists of a linear-gradient(to right, color1, color2) that is blended (screen) with two images that have been desaturated and have an opacity of X% each.

I'm nearly there now but struggling to desaturate my images and drop the opacities without affecting the colour of the gradients. How can I apply these? Pseudo selectors??

My current code looks like:

<div class="landingPageBackground">
    ...landing page code
</div>

.landingPageBackground {
    height: 100vh;
    width: 100vw;
    background: 
        url("./images/BridalHair_h720_72dpi.jpg"), 
        url("./images/LowKey_Boudoir3.jpg"),
        linear-gradient(to right, var(--ATP_Blue_Grad_1), var(--ATP_Blue_Grad_2));
    background-size: auto 70vh, 60vw auto, 100%;
    background-position: top left, bottom right;
    background-repeat: no-repeat;
    background-blend-mode: screen;

    /* need to drop opacity of each image individually and desaturate each one too */
}

Any help would be appreciated.

Thanks

来源:https://stackoverflow.com/questions/58717398/css-background-image-screen-opacity-and-saturation-with-linear-gradient

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!