編碼的世界 / 優質文選 / 生涯

css 實現弧形背景


2022年5月19日
-   

.pure_top {
width: 100%;
height: 100px;
position: relative;
z-index: 0;
overflow: hidden;
}
.pure_top::after {
content: '';
width: 120%;
height: 100px;
position: absolute;
left: -10%; //橢圓左邊隱藏10%,右邊隱藏10%
top: 0;
border-radius: 0 0 50% 50%; //左上角,右上角,右下角,左下角
background: #1496f1;
}

熱門文章