设置border-image后border-radius不生效的问题解决
html代码:
"utf-8">文档标题 我的第一个HTML页面
我的第一个段落。
class='div'>
css代码
.div{
width:200px;
height:200px;
border:solid 10px ;
border-image:linear-gradient(45deg,gold,deeppink) 1;
border-radius:10px;
}
效果图:
可以看到我们设置的 border-radius:10px; 没有生效
border-radius:10px;
解决方法:给我们的css加上 clip-path: inset(0 round 10px);
.div{ width:200px; height:200px; border:solid 10px ; border-image:linear-gradient(45deg,gold,deeppink) 1; clip-path: inset(0 round 10px); }
解决后的效果图如下: (完美解决)