css3背景顏色漸變

qaakd發表於2020-10-12

.gradient{
background: -moz-linear-gradient(top, #000000 0%, #ffffff 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#000000), color-stop(100%,#ffffff));
background: -webkit-linear-gradient(top, #000000 0%,#ffffff 100%);
background: -o-linear-gradient(top, #000000 0%,#ffffff 100%);
background: -ms-linear-gradient(top, #000000 0%,#ffffff 100%);
background: linear-gradient(to bottom, #000000 0%,#ffffff 100%); /*由上往下漸變(白色漸變到黑色)*/
background: linear-gradient(to left, #000000 0%,#ffffff 100%); /*由左往右漸變(白色漸變到黑色)*/
}

相關文章