gpt4 book ai didi

html - 如何使 `clip-path` 中的径向 Angular 看起来干净?

转载 作者:行者123 更新时间:2023-11-28 01:19:08 27 4
gpt4 key购买 nike

我正在尝试制作一个形状不寻常的登录表单,但我正在努力处理 border-radius<div> 上用clip-path .

这是我在 <div> 上使用的 CSS :

background: red;
height: 80%;
-webkit-clip-path: polygon(100% 0, 0 0, 100% 100%);
clip-path: polygon(100% 0, 0 0, 100% 100%);
border-radius: 5em;

目前看起来是这样的:

Picture showcasing the problem.

如您所见,border-radius在左上角和右下角被切断。是否有解决方法可以使它变得干净?

我希望它们不会被切掉,如下图所示。

Picture showcasing the desired result.

最佳答案

试试这个:

.block {
background: red;
height: 300px;
width: 200px;
clip-path: polygon(0 0, 100% 0, 100% 100%, 0 0);
border-radius: 10px;
}
 <div class="block"></div>

关于html - 如何使 `clip-path` 中的径向 Angular 看起来干净?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51616941/

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