纯css实现颜色数组变量显示效果代码
代码语言:html
所属分类:布局界面
代码描述:纯css实现颜色数组变量显示效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
.box {
--colors: red, blue, green, purple; /* color array */
--n: 4; /* length of the array */
--i: 0; /* index of the color [0 to N-1] */
width: 150px;
aspect-ratio: 1;
background:
linear-gradient(var(--colors)) no-repeat
0 calc(var(--i)*100%/(va.........完整代码请登录后点击上方下载按钮下载查看
网友评论0