CSS实现底部弧度效果--卡片样式

效果图展示

效果图

代码部分

代码说明、注解

使用了 CSS 的一些属性:
:after 伪类
position 定位
border-radius 圆角边框
linear-gradient 背景颜色渐变
display: flex; flex 布局
box-shadow 盒子阴影

html 代码

<div class="card-wrap">
  <div class="card-box">
    <div class="card-info">content</div>
  </div>
</div>

css 代码

.card-wrap {
  width: 100%;
  height: 188px;
  position: relative;
  z-index: -1;
  overflow: hidden;
}

.card-wrap:after {
  width: 140%;
  height: 168px;
  position: absolute;
  left: -20%;
  top: 0;
  z-index: -1;
  content: '';
  border-radius: 0 0 50% 50%;
  background: linear-gradient(144deg, #3c9cef 0%, #5f6bfd 100%);
}

.card-box {
  position: absolute;
  bottom: 10px;
  width: 100%;

  .card-info {
    margin: auto;
    width: 92%;
    height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    box-shadow: 0 4px 8px 0 rgba(190, 195, 199, 0.5);
    border-radius: 8px;
  }
}
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容