2011-11-19 45 views

回答

3

這應該可以做到。活例如:http://jsfiddle.net/tw16/mBUZt/

我已經使用了最新的格式對CSS3梯度:

html,body{height: 100%} /* added this as the example is an empty page */ 
body{ 
    background: -moz-linear-gradient(top, #319ef7 0%,#1b388e 200px,#1b388e 100%); 
    background: -webkit-linear-gradient(top, #319ef7 0%,#1b388e 200px,#1b388e 100%); 
    background:  -o-linear-gradient(top, #319ef7 0%,#1b388e 200px,#1b388e 100%); 
    background:  -ms-linear-gradient(top, #319ef7 0%,#1b388e 200px,#1b388e 100%); 
    background:   linear-gradient(top, #319ef7 0%,#1b388e 200px,#1b388e 100%); 
} 
+0

@alfo:使用純色和在'body'的梯度之間的差,是它需要爲100 %高度。你會在我的實例中看到這個工作。 – tw16