css - 删除由使用边框半径引起的空白

标签 css

我有两个由“border-top-left-radius: 500px 20px;”分隔的 div 元素和“border-top-right-radius: 500px 20px;”。我的问题是用前一个 div 元素的颜色填充由该半径引起的空白。 Here is a picture of my problem.如您所见,两个 div 之间的 Angular 落有空白区域,我需要用上部 div 的灰色填充。

.upper {
    background-color: grey;
    overflow:hidden;
}

.downer {
    border-top-left-radius: 500px 20px;
    border-top-right-radius: 500px 20px;
    border-bottom: none;
    border-left: none;
    border-right: none;
}

最佳答案

我通过向第二个 div 添加重叠方法 position: relative;bottom: 18px; 解决了我的问题。所以第二个 div 的 css 代码看起来像这样

.downer {
   position: relative;
   bottom: 18px;
   border-top-left-radius: 500px 20px;
   border-top-right-radius: 500px 20px;
   border-bottom: none;
   border-left: none;
   border-right: none;

关于css - 删除由使用边框半径引起的空白,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51736805/

相关文章:

css - HTML5 输入模式在输入类型 ="number"中不起作用

css - 如何在纸图标按钮的标签后获取伪元素

html - 具有 float 属性的中心跨度元素

javascript - 如何替换 youtube 链接并使其正常工作?

css - 为什么这个 float div不进入它的父元素?

html - 尝试使用 css 和 html 创建水平 Accordion

javascript - Bootstrap 模态在侧栏中呈现

jquery - 如何使用 jQuery 将类应用于输入项

javascript - 来自 API 调用的图像渲染 - React Native

jquery - 在动态生成的按钮中垂直对齐 fa-icon