1

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 );
}

繰り返しの背景

4

1 に答える 1

3

あなたはこれを必要とします

html, body {
   height: 100%;
}

body {
   background-position: fixed;
   /* Gradient dump goes here */
}
于 2013-03-21T18:32:58.193 に答える