colorzilla梯度发生器

时间:2013-03-21 18:31:42

标签: css background linear-gradients

我在colorzilla中生成了渐变背景,我把它放在css文件中,正如你在这段代码中看到的那样,它不断重复我的背景。我希望这个背景从它开始到页面结尾。

body{
    background: #1d6fa4;
    background: -moz-linear-gradient(-45deg,  #1d6fa4 1%, #499bc8 26%, #51abc9 52%, #3e94c1 74%, #277cad 100%);
    background: -webkit-gradient(linear, left top, right bottom, color-stop(1%,#1d6fa4), color-stop(26%,#499bc8), color-stop(52%,#51abc9), color-stop(74%,#3e94c1), color-stop(100%,#277cad));
    background: -webkit-linear-gradient(-45deg,  #1d6fa4 1%,#499bc8 26%,#51abc9 52%,#3e94c1 74%,#277cad 100%);
    background: -o-linear-gradient(-45deg,  #1d6fa4 1%,#499bc8 26%,#51abc9 52%,#3e94c1 74%,#277cad 100%);
    background: -ms-linear-gradient(-45deg,  #1d6fa4 1%,#499bc8 26%,#51abc9 52%,#3e94c1 74%,#277cad 100%);
    background: linear-gradient(135deg,  #1d6fa4 1%,#499bc8 26%,#51abc9 52%,#3e94c1 74%,#277cad 100%);
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1d6fa4', endColorstr='#277cad',GradientType=1 );
}

repeating background

1 个答案:

答案 0 :(得分:3)

你需要这个

html, body {
   height: 100%;
}

body {
   background-position: fixed;
   /* Gradient dump goes here */
}