剖面背景图片和线性渐变不起作用

Sar*_*ah 1 html css linear-gradients css3

我正在尝试添加具有线性渐变的背景图像。

如果我添加的图像没有线性渐变,则会显示图像。一旦添加了线性渐变,它们都不起作用,并且默认恢复为该部分中的原始背景色。

在下面的CSS中,我尝试将背景图片合并为一个CSS声明,并用逗号将其分开。

.education {
  background: linear-gradient(rgba(141, 153, 174, 0.8), (rgba(141, 153, 174, 0.5)), url("samuel-beckett-bridge.jpg") no-repeat fixed);
  background-size: cover;
}
Run Code Online (Sandbox Code Playgroud)
<!-- // Education -->
<section id="education" class="education">
  <div class="content-wrap">
    <h2>Education</h2>

    <!-- School details: copy this whole block to add more schools. -->
    <h3>School name 2017 - present</h3>
    <p>Designation received</p>

    <!-- Add as many paragraphs as you need. -->
    <p>Summary.</p>
    <!-- End of school details. -->
  </div>
</section>
Run Code Online (Sandbox Code Playgroud)

小智 5

绝对是:

.education {
  background: linear-gradient(rgba(141, 153, 174, 0.8), rgba(141, 153, 174, 0.5)), url("samuel-beckett-bridge.jpg") no-repeat fixed;
  background-size: cover;
}
Run Code Online (Sandbox Code Playgroud)

实时解决方案:https : //jsfiddle.net/v47dk902/