要创建看起来像彩虹色的线性渐变,您可以尝试运行以下代码\
<!DOCTYPE html> <html> <head> <style> #demo { height: 100px; background: linear-gradient(to right, red,orange,yellow,green,blue,indigo,violet); } </style> </head> <body> <h2>Linear Gradient</h2> <div id = "demo">Rainbow</div><br> </body> </html>