如果希望所有圆角都相同,则可以在两个值之间使用斜线,或者可以对单个角使用选择器,并在两个角之间使用不带斜线的两个值来获得每个角的独立结果,例如 border-top-left-radius: 45px 80px;
这是三个示例(我添加了一个对称示例,类似于您的问题中的示例):
.x {
width: 300px;
height: 200px;
border: 2px solid green;
border-radius: 45px / 80px;
}
.y {
width: 300px;
height: 200px;
margin-top: 30px;
border: 2px solid red;
border-top-left-radius: 45px 80px;
border-top-right-radius: 125px 60px;
}
.z {
width: 300px;
height: 100px;
margin-top: 30px;
border: 2px solid blue;
border-top-left-radius: 80px 65px;
border-bottom-left-radius: 80px 65px;
border-top-right-radius: 80px 65px;
border-bottom-right-radius: 80px 65px;
}
<div class="x"></div>
<div class="y"></div>
<div class="z"></div>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句