dgl*_*esh 2 html css linear-gradients radial-gradients
我想实现带有渐变背景颜色的多条圆形线的横幅设计。我对此进行了更多研究。我无法找到与我关注的问题相关的问题。
波纹管代码用于创建纯色背景横幅。
.blue-cross-banner{
background: #0FA2EB;
border-radius: 30px;
padding: 4em;
margin: 1em;
}
Run Code Online (Sandbox Code Playgroud)
我无法上传横幅的 svg 格式。它显示圆形线条的渐变阴影颜色。我在这里找到了一些与我的问题相关的内容https://css-tricks.com/gradient-borders-in-css/。但这对我的担忧无济于事。
#grad2 {
background: linear-gradient(90deg, rgba(15, 162, 235, 0) 33.16%, #0FA2EB 85.35%);
border-radius: 30px;
}
Run Code Online (Sandbox Code Playgroud)
上面的css需要使用圆线的背景渐变色。
你可以像下面这样做:
.box {
height: 150px;
background: linear-gradient(90deg, red, yellow);
position: relative;
overflow: hidden;
border-radius:20px;
}
.box::before {
content: "";
position: absolute;
width: 100%;
height: 200%;
top: 0;
left: 50%;
background: repeating-radial-gradient(circle, transparent 0 20px, blue 21px 23px);
clip-path: circle(farthest-side); /* to cut extra circles*/
}Run Code Online (Sandbox Code Playgroud)
<div class="box">
</div>Run Code Online (Sandbox Code Playgroud)