gpt4 book ai didi

html - 两行文本的边框半径四舍五入

转载 作者:行者123 更新时间:2023-12-04 15:24:13 26 4
gpt4 key购买 nike

我正在尝试创建一个多线圆 Angular 边框,就像照片所附的那样。但我只能分别对每一行执行此操作(请参阅代码/codepen)。有没有办法用 css 做这个或者它是 JS 的东西?

<div class="background">
<div>
<span>This is text This is text This is text This is text</span> <br> <span>This is text This is text This is text This is text This is text </span>
</div>
</div>
.background {
background-color: black;
padding: 5rem;
}

span {
display: inline-block;
color: white;
background: red;
border-radius: 15px;
-moz-border-top-left-radius: 15px;
-webkit-border-top-left-radius: 15px;
border-top-left-radius: 15px;
-moz-border-bottom-right-radius: 15px;
-webkit-border-bottom-right-radius: 15px;
border-bottom-right-radius: 15px;
-moz-border-top-right-radius: 15px;
-webkit-border-top-right-radius: 15px;
border-top-right-radius: 15px;
-webkit-box-decoration-break: clone;
-o-box-decoration-break: clone;
box-decoration-break: clone;
padding: 15px;
color: white;
font-size: 50px;
text-transform: uppercase;
font-weight: 500;
}

https://codepen.io/mattmcgilton/pen/BajwvRv

enter image description here

最佳答案

.background {
background-color: black;
padding: 5rem;
}

span {
display: inline-block;
color: white;
background: #ED242E;
border-radius: 5px;
-webkit-box-decoration-break: clone;
-o-box-decoration-break: clone;
box-decoration-break: clone;
padding: 15px;
color: white;
font-size: 21px;
text-transform: uppercase;
font-weight: 700;
}

.background span:first-child {
border-bottom-left-radius: 0;
}

.background span:last-child{
border-top-right-radius: 0;
border-top-left-radius: 0
}
<div class="background">
<div>
<span>This is text This is text This is Text</span> <br> <span>This is text This is text </span>
</div>
</div>

关于html - 两行文本的边框半径四舍五入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62649515/

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