如何用CSS制作平滑的半圆形tabbar?-灵析社区

喵酱魔法师

![image.png](https://wmprod.oss-cn-shanghai.aliyuncs.com/c/user/20241012/c6e2255c0d0425b954f5e709cee0860b.png) 请问怎么把vantUI里的van-tabbar改造成这样凸起来比较平滑的半圆呀 用过伪元素,但是效果不太好 画出来的效果是这样,中间有一条细线,不知道你们能不能看出来,而且跟下面的tabbar的左右连接处不是很丝滑 ![image.png](https://wmprod.oss-cn-shanghai.aliyuncs.com/c/user/20241012/e6e620a0de2c7fd4b47785d5ed06f621.png) 用这两个div画出来了,有线是因为van-tabbar的z-index太高了。 .centerIcon { position: fixed; width: 62px; height: 31px; background: #fff; border-radius: 31px 31px 0 0; left: calc(50% - 31px); bottom: 48px; z-index: 998; } .centerIcon-bg { position: fixed; width: 46px; height: 46px; background: linear-gradient(to bottom right, #5468fa 0%, #68bafd 100%); border-radius: 23px; left: calc(50% - 23px); bottom: 25px; z-index: 999; display: flex; align-items: center; justify-content: center; }

阅读量:186

点赞量:0

问AI
小飞侠007
你就按几何形状做,没必要那么扣细节。 就是一个长方形叠加一个圆形 z轴长方形在下面,圆形在上面就行了。 "image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/c/user/20241012/8be581b3224ea877dc8a293461723ece.png)