CSS实现边框渐变色

border有个border-image的属性,类似background也有个background-image一样,通过为其设置渐变颜色后,实现的渐变,后面的数字4为x方向偏移量

.border-grident{
  margin-top: 20px;
  width: 200px;
  height: 200px;
  border: 4px solid;
  border-image: linear-gradient(to right, #8f41e9, #578aef) 4;
}
posted @ 2024-04-16 15:41  Felix_Openmind  阅读(388)  评论(0)    收藏  举报
*{cursor: url(https://files-cdn.cnblogs.com/files/morango/fish-cursor.ico),auto;}