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>