body
{
background-image: -webkit-linear-gradient(bottom, #FFFFFF 0%, #787878 100%);
}
当然,当我想要一个真正的渐变时,我会得到这种效果。有任何想法吗?
You make this work properly, you need:
body, html {
background: -webkit-linear-gradient(top, #FFFFFF 0%, #787878 100%);
margin:0;
height:100%;
}
试试这个:http: //jsfiddle.net/3rb2L/2/
body
{
background-image: -webkit-linear-gradient(top, #2F2727, #1a82f7);
background-repeat: no-repeat;
height:200px;
}
height:200px
仅用于示例和明确的查看目的。
可以用作:http: //jsfiddle.net/3rb2L/4/
html{
min-height:100%;
}
body
{
background-image: -webkit-linear-gradient(top, #2F2727, #1a82f7);
background-repeat: no-repeat;
}