0
我发布的代码是做我想做的,但我想要从CSS中删除linear-gradient
。问题是,当我把它拿出来,它影响了背景图像的显示方式。线性渐变影响背景大小:覆盖
.hero-cover {
background-image: -webkit-linear-gradient(270deg,rgba(0,0,0,.55),rgba(0,0,0,.55)),url(http://monstacdn.com/dd/images/assets/cover.jpg);
background-image: linear-gradient(180deg,rgba(0,0,0,.55),rgba(0,0,0,.55)),url(http://monstacdn.com/dd/images/assets/cover.jpg);
background-position: 0 0,50% 100%;
background-size: auto,cover;
}
<div class="section hero-cover">
<div style="padding:100px;"></div>
</div>