1、首先打开工具,新建一个HTML文档!
2、创建一个div盒子,并添加基本样式(以DIV为大家演示)
3、添加线性渐变效果:语法:background-image: linear-gradient(direction, color-stop1, color-stop2, ...);演示代码:background-image: linear-gradient(to right, red , yellow);
4、添加径向渐变效果:语法:background-image: radial-gradient(shape size at position, start-color, ..., last-color);演示代码:background-image: radial-gradient(circle, red, yellow, green);
5、最后,我打开浏览器来看看效果吧!