CSS图像背景和渐变 - 将它们分成两行?

时间:2017-12-16 18:16:35

标签: css css3 background-image linear-gradients

我如何分开

background-image: linear-gradient(to bottom, rgba(255,0,0,0), rgba(0,0,0,0.5)), url("../images/3.jpg");

例如(当然不起作用):

background-image: linear-gradient(to bottom, rgba(255,0,0,0));
background-image: url("../images/3.jpg");

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

您需要使用逗号分隔渐变和图像。

background: linear-gradient(to bottom, rgba(255,0,0,0)),
            url("../images/3.jpg");