首页 > 解决方案 > 将多层背景与单独的蒙版结合起来

问题描述

我有几个图像的背景,我想给它们动态颜色,所以我的计划是堆叠多种颜色而不是图像,并给每种颜色一个蒙版。我就是这样尝试的:

前:

background:
    url(/static/img/2x2black.svg) repeat-x top,
    url(/static/img/2x2black.svg) repeat-x bottom,
    var(--color-ground);

后:

background:
    var(--color-onground),
    var(--color-onground),
    var(--color-ground);
mask:
    url(/static/img/2x2black.svg) repeat-x top,
    url(/static/img/2x2black.svg) repeat-x bottom,
    none;

但这不起作用。

标签: cssmask

解决方案


推荐阅读