gpt4 book ai didi

html - 带弧形尖底的表头

转载 作者:太空狗 更新时间:2023-10-29 14:55:01 25 4
gpt4 key购买 nike

我需要创建下图所示的蓝色/绿色区域。它有倾斜的边,向下延伸到一个略微 flex 的点。

使用 CSS 实现此目的的最佳方法是什么?如果无法支持 IE9,我需要支持 IE9+ 或 IE10+。

我已经开始了一个基本的demo here -(不需要蓝绿色区域内的内容)

header with curved pointed bottom

最佳答案

这是我仅使用 css 的尝试:

.header {
background: #415d67;
height: 150px;
position: relative;
z-index: 1;

}
.header:after {
position: absolute;
content: "";
background: #415d67;
width: 50%;
bottom: -20px;
right: 0;
height: 100%;
transform: skewY(-5deg);
transform-origin: right;
border-bottom-left-radius: 50px;
padding-right: 44px;
z-index: -1;
}
.header:before {
position: absolute;
content: "";
background: #415d67;
width: 50%;
bottom: -20px;
left: 0;
height: 100%;
transform: skewY(5deg);
transform-origin: left;
border-bottom-right-radius: 50px;
padding-left: 44px;
z-index: -1;
}
.content {
background: white;
padding: 20px;
padding-top: 100px;
}

JSBIN demo

您也可以考虑使用 svg 图形。

关于html - 带弧形尖底的表头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36392688/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com