html背景颜色渐变色代码,css3背景渐变色代码

从上到下

#grad {

background: -webkit-linear-gradient(red, blue);

background: -o-linear-gradient(red, blue);

background: -moz-linear-gradient(red, blue);

background: linear-gradient(red, blue);

}

从左到右

#grad {

background: -webkit-linear-gradient(left, red , blue);

background: -o-linear-gradient(right, red, blue);

background: -moz-linear-gradient(right, red, blue);

background: linear-gradient(to right, red , blue);

}

从左上到右下

#grad {

background: -webkit-linear-gradient(left top, red , blue);

background: -o-linear-gradient(bottom right, red, blue);

background: -moz-linear-gradient(bottom right, red, blue);

background: linear-gradient(to bottom right, red , blue);

}

使用角度

#grad {

background: -webkit-linear-gradient(180deg, red,

你可能感兴趣的:(html背景颜色渐变色代码)