【问题标题】:colozilla gradient generatorcolorzilla 渐变生成器
【发布时间】:2013-03-21 18:31:42
【问题描述】:

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

【问题讨论】:

    标签: css background linear-gradients


    【解决方案1】:

    你需要这个

    html, body {
       height: 100%;
    }
    
    body {
       background-position: fixed;
       /* Gradient dump goes here */
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-12-10
      • 1970-01-01
      • 2010-11-19
      • 1970-01-01
      • 2011-03-31
      • 2022-07-28
      相关资源
      最近更新 更多