當我爲我的網頁添加背景色漸變時,它直到我體元素中最後一個容器的末尾都能正常工作。之後,漸變停止工作,您會看到容器的末尾和空白頁的其餘部分之間的明顯對比。背景漸變無法正確顯示引導程序3
看到自己:
下載的默認網頁從layoutit.com和編輯CSS/style.css中有:
body {
background: #1e5799; /* Old browsers */
background: -moz-linear-gradient(top, #1e5799 0%, #207cca 30%, #2989d8 50%, #7db9e8 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#1e5799), color-stop(30%,#207cca), color-stop(50%,#2989d8), color-stop(100%,#7db9e8)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #1e5799 0%,#207cca 30%,#2989d8 50%,#7db9e8 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #1e5799 0%,#207cca 30%,#2989d8 50%,#7db9e8 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #1e5799 0%,#207cca 30%,#2989d8 50%,#7db9e8 100%); /* IE10+ */
background: linear-gradient(to bottom, #1e5799 0%,#207cca 30%,#2989d8 50%,#7db9e8 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#1e5799', endColorstr='#7db9e8',GradientType=0); /* IE6-9 */
}
被http://www.colorzilla.com/gradient-editor/生成CSS,所以我相當它確實有效,因爲它似乎是製作漸變的流行選擇,它可以在非引導頁面上工作。
有關如何讓漸變渲染整個頁面的任何想法?
編輯 查看在http://theshachar.com/so/
感謝一個例子!
將其設置在'html'元素上,而不是'body'元素。我認爲這就是bootstrap的作用。 –
試過了,它效果更糟。漸變在容器中不起作用,但頁面底部仍然獲得開始的漸變顏色 – mlobl
有趣的 - 你有我們可以看看的例子嗎?也許是一個網站或jsFiddle的例子? –