如何使用CSS创建以下彩虹效果?
即具有实心彩虹颜色停止的顶部圆角边框(无需插入HTML)。
即具有实心彩虹颜色停止的顶部圆角边框(无需插入HTML)。
颜色值为:#c4e17f, #f7fdca, #fad071, #f0766b, #db9dbe, #c49cdf, #6599e2, #61c2e4
目前我尝试过的方法:
.container {
background: #596678;
width: 100%;
height: 300px;
display: flex;
justify-content: center;
align-items: center;
}
.top-round-rainbow {
width: 50%;
height: 50%;
background: white;
border-radius: 4px;
background-image: repeating-linear-gradient(to right, #c4e17f 50px, #f7fdca 50px, #fad071 50px, #f0766b, #db9dbe, #c49cdf, #6599e2, #61c2e4);
}
<div class="container">
<div class="top-round-rainbow">
</div>
</div>