CSS教程】 【Web前端基础】背景颜色渐变css3如何做

2020-10-29 09:39发布

5条回答
孙哈哈
2020-11-04 19:16

background-image: linear-gradient(方向,颜色 渐变位置,颜色 渐变位置...)

direction 方向:  1. to top ,to left, to right, to bottom

2. 角度deg  45deg    90deg

 background-image:linear-gradient(to right,red 20%,blue 50%);

background-image:radial-gradient(形状 大小  中心位置,颜色 停止位置,颜色 停止位置...)

形状:circle 圆形    ellipse 椭圆  (背景是长方形)

大小:最近边closest-side    最远边 farthest-side   最近角 closest-corner  最远角 farthest-corner

中心位置:at  10px 10px

 background:radial-gradient(circle closest-corner at 50px 50px,yellow 10%,red 80%);


一周热门 更多>