css漂亮的弧形

我们有时会遇到要用实现一个弧形,而这样的弧形要怎么实现呢?
用图片?好像不大现实,因为这样就要无故多加载一张图片了
,这里我们来说说怎么用css的after伪类来实现弧形。

如果想要调整弧度的话,可以通过高读来调整的;

<view class="bb"></view>

.bb{
		width: 100%;
		height: 140px;
		position: relative;
		z-index: -1;
		overflow: hidden;
	}

	.bb::after {
		content: '';
		width: 120%;
		height: 100px;
		position: absolute;
		left: -10%;
		top: 0;
		z-index: -1;
		border-radius: 0 0 60% 60%;
		background: #1496f1;
	}
	

 <view class="aa"></view>

.aa{
	width:100%;    
	height: 330rpx;  
	position: relative;  
	z-index: -1;  
	overflow: hidden;
}

.aa::after{
	content:''; 
	width: 100%; 
	height: 330rpx; 
	position: absolute; 


	left: 0;
	top:0;
	z-index: -1; 
	border-radius: 0 0 50% 50%;  
	background: #1496F1;
}

posted @ 2020-09-01 21:39  何人陪我共长生  阅读(4541)  评论(0编辑  收藏  举报