12345678910111213141516171819202122232425262728293031323334353637383940 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Document</title>
- <style>
- .box{
- width: 500px;
- height: 500px;
- border: 1px solid black;
- /* background-image 背景渐变色 */
- /* linear-gradient 线性渐变 */
- /* background-image: linear-gradient(red,blue); */
- /* 第一个参数可以控制渐变色的方向 to right 从左向右。to left 从右向左 */
- /* background-image: linear-gradient(to right,red,blue); */
- /* to left bottom 从右上到左下 */
- /* background-image: linear-gradient(to left bottom,red,blue); */
- /* 多个颜色值 */
- /* background-image: linear-gradient(red,blue,yellow); */
- /* 角度值 */
- /* background-image: linear-gradient(15deg,red,blue); */
- /* 径向渐变 */
- /* background-image: radial-gradient(red,blue); */
- background-image: linear-gradient(rgba(77,77,77,0),black);
- }
- </style>
- </head>
- <body>
- <div class="box"></div>
- </body>
- </html>
|