html - 如何用div和css创建一个圆弧的边?

标签 html css

<分区>

我尝试创建一个这样的元素:

enter image description here

我无法根据直径创建一段圆弧,通过玩弄 Angular 边缘,它看起来不像我希望的那样。 我的结果:https://codepen.io/yoan-dev/pen/rNJNPPN

.main {
  bottom: 0px;
  width: 100%;
  height: 70px;
  background-color: blue;
  border-top-left-radius: 100% 80px;
  border-top-right-radius: 100% 80px;
}
<a href="#">
  <div class="main"></div>
</a>

最佳答案

你可以试试border-top

.main {
  bottom: 0px;
  width: 100%;
  height: 70px;
  background-color: white;
  border-top-left-radius: 100% 80px;
  border-top-right-radius: 100% 80px;
  border-top: 2px solid #ccc;  
}
<a href="#">
  <div class="main"></div>
</a>

关于html - 如何用div和css创建一个圆弧的边?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72083328/

相关文章:

html - 尝试添加下拉菜单后导航栏和内容四处移动

html - 使用纯 HTML 在电子邮件中并排创建响应式图像

html - Drupal View - 新的过滤条件从下拉菜单重置为自动完成

html - 我可以使用什么代替 Display Flex 来支持 IE9

javascript - ajax成功后删除div

html - 将图像添加到 Bootstrap 导航栏会使其大小错误

html - 如何将箭头添加到div?

css - 为什么我的字体在我的网站上截断了字母的顶部和底部?

javascript - 无法在 gmap-window 中设置未定义的属性 'opacity'

html - 全宽网页