所以我想有一個漸變填充100%的網頁背景。對於無法處理它的瀏覽器,純色很好。<body> css漸變背景延伸到100%的寬度和高度
這裏是我當前的css:
html {
height: 100%;
}
body {
height: 100%;
margin: 0;
padding: 0;
background-repeat: no-repeat;
background: #afb1b4; /* Old browsers */
background: -moz-linear-gradient(top, #afb1b4 0%, #696a6d 100%) no-repeat; /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#afb1b4), color-stop(100%,#696a6d)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #afb1b4 0%,#696a6d 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #afb1b4 0%,#696a6d 100%); /* Opera11.10+ */
background: -ms-linear-gradient(top, #afb1b4 0%,#696a6d 100%); /* IE10+ */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#AFB1B4', endColorstr='#696A6D',GradientType=0); /* IE6-9 */
background: linear-gradient(top, #afb1b4 0%,#696a6d 100%); /* W3C */
}
它似乎摸出而頁面沒有什麼內容,但我已經有更多的內容,導航,等等填寫頁面,現在一些有底部爲白色。也許100px左右。我做錯了嗎?我需要在某處補償某些填充嗎?
看起來像你從這裏得到這個:http://www.colorzilla.com/gradient-editor/ – Jason 2011-05-16 23:35:43
@Jason,我做到了,這是非常徹底的跨瀏覽器,我喜歡。但是,我還沒有測試非FF瀏覽器。這一點很快就會到來。 – Unfortunately 2011-05-17 00:08:51
我使用它很多。它非常跨瀏覽器,並且運行得非常好。 – Jason 2011-05-17 00:16:20