0

从顶部 #3a5976 和底部 #2c4762

抱歉,如果阅读困难,请将其复制到您的文本编辑器中

<html>
  <head>
    <style>
      body {
        background-image: linear-gradient(bottom, rgb(70,125,149) 19%, 
                          rgb(98,163,179) 60%, 
                          rgb(56,122,122) 80%);
        background-image: -o-linear-gradient(bottom, rgb(70,125,149) 19%, 
                          rgb(98,163,179) 60%, 
                          rgb(56,122,122) 80%);
        background-image: -moz-linear-gradient(bottom, rgb(70,125,149) 19%, 
                          rgb(98,163,179) 60%, 
                          rgb(56,122,122) 80%);
        background-image: -webkit-linear-gradient(bottom, rgb(70,125,149) 19%, 
                          rgb(98,163,179) 60%, 
                          rgb(56,122,122) 80%);
        background-image: -ms-linear-gradient(bottom, rgb(70,125,149) 19%, 
                          rgb(98,163,179) 60%, 
                          rgb(56,122,122) 80%);
           }
    </style>
  </head>
  <body>

  </body>

4

1 回答 1

0

用您的十六进制值替换示例中的 rgb() 值:

body{
background-color: #2c4762; /* fallback for browsers that don't support gradient */
background-image: linear-gradient(bottom, #2c4762, #3a5976 );
background-image: -o-linear-gradient(bottom, #2c4762, #3a5976 );
background-image: -moz-linear-gradient(bottom, #2c4762, #3a5976 );
background-image: -webkit-linear-gradient(bottom, #2c4762, #3a5976 );
background-image: -ms-linear-gradient(bottom, #2c4762, #3a5976 );
}

这是一个工作小提琴(使用#content DIV代替body):http: //jsfiddle.net/daNUM/

于 2013-09-27T17:49:12.807 回答