CSS实现矩形两边挖半圆凹槽


想要实现这种效果,准备个矩形盒子

<view class="content-box"></view>

css样式如下:

.content-box{
    
    
  width: 630rpx;
  height: 480rpx;
  position: relative;
  background-color: #fff;
  margin: 30rpx 60rpx 40rpx;
}
.content-box:after {
    
    
  position: absolute;
  content: "";
  width: 20px;
  height: 20px;
  background: #eef1f9;
  border-radius: 100%;
  right: 0;
  top: 50%;
  transform: translate(50%, -50%);
}

.content-box:before {
    
    
  position: absolute;
  content: "";
  width: 20px;
  height: 20px;
  background: #eef1f9;
  border-radius: 100%;
  left: 0;
  top: 50%;
  transform: translate(-50%, -50%);
}

猜你喜欢

转载自blog.csdn.net/weixin_44738158/article/details/123280349