gpt4 book ai didi

html - 如何在不使边框线变圆的情况下获得 CSS 圆 Angular ?

转载 作者:太空宇宙 更新时间:2023-11-03 23:11:31 24 4
gpt4 key购买 nike

我正在使用 border-radius 来圆化一个 div 的 Angular 。我在 div 的底部也有一条边框线。像这样:

<div style="border-radius: .5em; border-bottom: 1px solid black">Content</div>

但是,我不希望边界线有圆边。我希望边界线完全笔直。有办法实现吗?

最佳答案

可以使用伪元素(::before)模拟直线边框

CSS

div{
position: relative;
border-radius: .5em;
background: #ccc;
}

div:before{
position: absolute;
content: "";
display:block;
bottom:0;
left:0;
right:0;
height: 1px;
background: #000;

}

DEMO HERE

关于html - 如何在不使边框线变圆的情况下获得 CSS 圆 Angular ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32349258/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com