html - 边框半径仅围绕div的顶部?
问题描述
在带边框的 div 上应用border-radius 属性只会将其应用于顶角。这是为什么?
例子:
https://jsfiddle.net/07tqbo56/1/
.asd {
margin-top: 35px;
width: 123px;
border-top-style: solid;
border-top-color: #1163b9;
border-top-width: 70px;
border-radius: 70px;
}
<div class="asd"></div>
这就是它在 Firefox 72、Ubuntu 19 上的样子。
解决方案
不仅在 FireFox 中,它在所有浏览器中都会如此,
你想这样做吗?
刚刚删除了中的“顶部” border-style, -color and -width
。“顶部”只会在设计的顶部进行更改。
.asd {
margin: 35px;
width: 123px;
border-style: solid;
border-color: #1163b9;
border-width: 70px;
border-radius: 70px;
}
<div class="asd"></div>
我希望这可以解决您的问题。
推荐阅读
- scala - 在 Scala 中合并两个 Future[Map[T1, T2]] 的最佳方法是什么
- javascript - 不能将 window.innerWidth 与比较运算符一起使用
- publish-subscribe - Pub/Sub 忽略发布给自己
- c# - 代码片段快捷方式不适用于 Visual Studio 2019 和 Intellisense
- excel - Excel COM 对象未发布 (vb.net)
- python - python 交易机器人(纸面交易)
- java - Spring Data MongoDB Pagination 导致扫描对象/返回 > 1000
- avaloniaui - 更新订阅任务中的 UI
- python - Python 的数独检查器问题
- sql-server - 如何解决无法在函数中插入或删除的问题