9.渐变色.html 793 B

123456789101112131415161718192021222324
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Document</title>
  7. <style>
  8. #box {
  9. width: 300px;
  10. height: 300px;
  11. border: 2px solid #000;
  12. margin: 150px auto;
  13. background-image: radial-gradient(circle at 30% 70%,red,yellow,blue)
  14. /* background-image: radial-gradient(circle at top left,red,yellow,blue) */
  15. /* background-image: radial-gradient(circle,red,yellow,blue) */
  16. /* background-image: linear-gradient(60deg,red,blue,yellow); */
  17. /* background-image: linear-gradient(to top right,red,blue); */
  18. }
  19. </style>
  20. </head>
  21. <body>
  22. <div id="box"></div>
  23. </body>
  24. </html>