在 CSS 中制作圆底角

Make rounded bottom corners in CSS

我正在尝试用 border-radius 制作一个底角圆润的 CSS 形状,但无法理解如何:

.rounded-css {
  border-radius: 5px;
  display: block;
  background: #669999;
  width: 150px;
  height: 200px;
}
<div class="rounded-css"></div>

预期输出:

你可以用border-radius: 0 0 50% 50%;把整个底部做成圆形。通过添加白色伪元素::after,您可以"cut"不需要的上半部分只显示曲线:

.rounded {
  border-radius: 0 0 50% 50%;
  display: block;
  background: #669999;
  width: 100%;
  height: 70px;
  margin-top: -35px;
}
.rounded::after {
  content: "";
  display: block;
  width: inherit;
  height: 35px;
  background: white;
}
<div class="rounded"></div>

我认为您可以根据要放入的容器进行调整。我认为这正是您要找的东西。

.rounded-css {
  border-radius: 100%;
  display: block;
  background: black;
  border-bottom: 40px #669999 solid;
  border-top: 40px transparent solid;
  position: relative;
  top: -60px;
  overflow: hidden;
}
<div class="rounded-css"></div>