我正在尝试添加具有线性渐变的背景图像。
如果我添加的图像没有线性渐变,则会显示图像。一旦添加了线性渐变,它们都不起作用,并且默认恢复为该部分中的原始背景色。
在下面的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)