css 矩形两边挖半圆


css:
 .bound{

background-color: #3EAAF2;
width: 300px;
height: 100px;
display: flex;
flex-direction: column;
align-items: center;
position: relative;//设置定位
}
.bound::before{
content: "";
width: 40px;
height: 40px;
border-radius: 50%;
display: block;
background: #fff;
position: absolute;
top:50%;
left: -20px;
transform:translateY(-50%);
}
.bound::after{
content: "";
width: 40px;
height: 40px;
border-radius: 50%;
display: block;
background: #fff;
position: absolute;
top:50%;
right: -20px;
transform:translateY(-50%);
}

 

html:

<div class="bound"></div>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM