gpt4 book ai didi

html - 循环方式的CSS3线性渐变

转载 作者:技术小花猫 更新时间:2023-10-29 12:51:18 24 4
gpt4 key购买 nike

我想知道是否可以用 css 渐变做这样的事情:

color wheel

我搜索了很多,所有渐变都是“线性”或“径向”。我想要的渐变是线性的,呈圆形!

最佳答案

-- 更新了 2022 年初的信息 --

它现在是可行的 - 至少对于大多数浏览器来说是这样。 CSS 属性 conic-gradient可以轻松实现这一点:

html, body { margin: 0; padding: 0; }
.box {
position: absolute;
width: 200px;
height: 200px;
left: 100px;
}
.colorwheel {
background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
border-radius:50%;
}
.fallback {
text-align: center;
padding: 50px 0;
}
<div class="fallback box">
If you can read<br>this, your browser<br>doesn't support<br>conic-gradient yet.
</div>
<div class="colorwheel box"></div>

此 CSS 函数在 CSS 图像模块级别 4编辑草案中指定,目前由大多数浏览器(包括许多移动浏览器)实现。检查Can I use获取当前支持。

关于html - 循环方式的CSS3线性渐变,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31423462/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com