html - 带弧形尖底的表头

标签 html css css-shapes

我需要创建下图所示的蓝色/绿色区域。它有倾斜的边,向下延伸到一个略微 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/

相关文章:

html - 在固定的 div 中滚动

jquery - 如何使菜单类似于 linkedin.com 上的菜单

css 列缩小 100% 像素值

html - 我可以只用 CSS 创建这个形状吗?

performance - HTML5 微数据 : How to prevent increasing the file size through Microdata

html - 当 tbody 设置为其容器的宽度时,我可以在 tbody 的溢出上实现水平滚动吗?

html - 多步表单 - 在样式单选按钮之间切换

css - 创建可以使用 html、css 填充颜色的自定义图形

像 Border Radius 这样的 CSS 设计

html - 转换背景和固定位置时如何摆脱重叠?