CSS改变背景颜色

时间:2015-12-21 22:18:42

标签: jquery html css fade

基本上我想将背景从黑色淡化为灰色,我用以下代码完成了这个:

@-webkit-keyframes fadeIt {
  0%   { background-color: #000000; }
  50%  { background-color: #1E1E1E; }
  100% { background-color: #3C3C3C; }
}

@-moz-keyframes fadeIt {
  0%   { background-color: #000000; }
  50%  { background-color: #1E1E1E; }
  100% { background-color: #3C3C3C; }
}

@-o-keyframes fadeIt {
  0%   { background-color: #000000; }
  50%  { background-color: #1E1E1E; }
  100% { background-color: #3C3C3C; }
}

@keyframes fadeIt {
  0%   { background-color: #000000; }
  50%  { background-color: #1E1E1E; }
  100% { background-color: #3C3C3C; }
}

body {
    background-image:none !important;
    -webkit-animation: fadeIt 5s ease-in-out; 
       -moz-animation: fadeIt 5s ease-in-out; 
         -o-animation: fadeIt 5s ease-in-out; 
            animation: fadeIt 5s ease-in-out;

    margin: 0 auto;
}

处理过渡后,颜色设置为白色并不理想,我希望将其设置为灰色。一个简单的

background-color: 000000;
身体中的

标签不会被淡入淡出覆盖,当淡入淡出完成后,如何设置超时以将其转换为灰色?

我使用的灰色十六进制是3C3C3C0x3C3C3C)(#3C3C3C

0 个答案:

没有答案
相关问题