我正在尝试为矩形上的倒边半径找到解决方案。 可以这样做吗? 我查看了每个带有形状生成器的站点,但没有找到任何东西。 我也想办法做到这一点,但只能在一个角落,而不是在例子中看到的中间。
我可能可以用 svg 以某种方式做到这一点,但是用 css 找到解决方案会很好。
关于能够更改一个角的半径(边框-[顶部或底部]-[左或右]-半径属性),您是正确的,但是通过应用具有相同半径的 2 个角,您可以实现这个确切的效果。
因为你需要在左下角和左上角,你可以使用下面的代码:
body {
background-color: #AF1414;
}
h2 {
color: white;
}
div {
background-color: #ffffff;
width: 100px;
height: 90px;
border-top-left-radius: 55px;
border-bottom-left-radius: 55px;
}
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<h2>Use this to apply the radius to (a) specific side(s)</h1>
<div class="side-radius"></div>
</body>
</html>
详情请见: