径向渐变-size
半径长短
-
closest-side:圆心到最近的边的距离开始渐变过渡;
<style> div{ width: 200px; height: 200px; background: #fff radial-gradient(closest-side circle at 50px 50px,#cf9,#000 ); } </style>
效果预览:
-
farthest-side:圆心到最远的边的距离开始渐变过渡;
<style> div{ width: 200px; height: 200px; background: #fff radial-gradient(farthest-side circle at 50px 50px,#cf9,#000 ); } </style>
效果预览
-
closest-corner:圆心到最近的角的距离开始渐变过渡;
<style> div{ width: 200px; height: 200px; background: #fff radial-gradient(closest-corner circle at 50px 50px,#cf9,#000 ); margin: 200px auto; } </style>
效果预览:
-
farthest-corner:圆心到最远的角的距离开始渐变过渡;
<style> div{ width: 200px; height: 200px; background: #fff radial-gradient(farthest-corner circle at 50px 50px,#cf9,#000 ); margin: 200px auto; } </style>
效果预览:
多张背景图
background:
radial-gradient(color,color,color) position/size,
radial-gradient(color,color,color) position/size,
radial-gradient(color,color,color) position/size;
背景图与背景图的样式用逗号(,)隔开