HTML+CSS 实现两只 圆锥渐变 合并形成的光台样式
737访客 20字under Website Notes of Programming tag html css Published on February 15th , 2022 at 05:55 pm
1. 镜面水平翻转法
源码
<div id="tBox1">
<div class="ta" id="t1"></div>
<div class="ta" id="t2"></div>
</div>
<style>
#tBox1 {
display: flex;
}
.ta {
width: 50%;
padding-bottom: 56.25%;
background: conic-gradient(from 90deg, blue, #6cf);
}
#t2 {
transform: rotateY(180deg);
}
</style>
2. 水平相反方向渐变法
源码
<div id="tBox2">
<div class="tb" id="t3"></div>
<div class="tb" id="t4"></div>
</div>
<style>
#tBox2 {
display: flex;
}
.tb {
width: 50%;
padding-bottom: 56.25%;
}
#t3 {
background: conic-gradient(from 90deg, blue, #6cf);
}
#t4 {
background: conic-gradient(from 270deg, #6cf, blue);
}
</style>
本页由 matcha 整理和发布,采用 知识共享署名4.0 国际许可协议进行许可,转载前请务必署名
文章最后更新时间为:April 16th , 2022 at 11:19 am
分享到:Twitter Weibo Facebook