簡體   English   中英

CSS-覆蓋圖像漸變

[英]CSS - Cover Image Gradient Over

我正在努力在封面圖像上放置一個漸變層。 我不明白為什么會這樣發生。

看下面的代碼。

來源: 牆紙

例如:

 header { position: relative; height: 300px; background-repeat: no-repeat; background-position: center bottom; background-image: url('http://wallpaperlatest.com/wp-content/uploads/latest-wallpapers-in-full-hd-definition.jpg'); background-size: cover; border-bottom-left-radius: 50%; border-bottom-right-radius: 50%; } h1 { margin: 0; padding: 100px 0; font: 44px "Arial"; text-align: center; } header h1 { color: white; } 
 <header> <h1>Header Content | Source: http://wallpaperlatest.com</h1> </header> <section> <h1>Section Content | Source: http://wallpaperlatest.com/</h1> </section> 

嘗試這個:

 header { position: relative; height: 300px; background-repeat: no-repeat; background-position: center bottom; background-image: linear-gradient(to bottom right, rgba(0, 47, 75, .8), rgba(220, 66, 37, .8)), url('http://wallpaperlatest.com/wp-content/uploads/latest-wallpapers-in-full-hd-definition.jpg'); background-size: cover; border-bottom-left-radius: 50%; border-bottom-right-radius: 50%; } h1 { margin: 0; padding: 100px 0; font: 44px "Arial"; text-align: center; } header h1 { color: white; } 
 <header> <h1>Header Content | Source: http://wallpaperlatest.com</h1> </header> <section> <h1>Section Content | Source: http://wallpaperlatest.com/</h1> </section> 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM