30_渐变色.html 1.0 KB

1234567891011121314151617181920212223242526272829
  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: 200px;
  10. height: 200px;
  11. /* background-color: blue; */
  12. /* background-image 背景图片 */
  13. /* linear-gradient 线性渐变 颜色可以是多个的 */
  14. /* background-image: linear-gradient(blue,red,yellow,green); */
  15. /* 可以控制渐变色方向 linear-gradient 第一个属性值 */
  16. /* to top 从下到上 to bottom 从上到下 to right 从左到右 to left 从右到左 */
  17. /* to right bottom 从左上到右下 */
  18. /* background-image: linear-gradient(to right bottom,blue,red); */
  19. /* 可以控制渐变色角度 linear-gradient 第一个值 */
  20. background-image: linear-gradient(15deg,blue,red);
  21. }
  22. </style>
  23. </head>
  24. <body>
  25. <div class="box"></div>
  26. </body>
  27. </html>