Gradient borders

后端 未结 17 1363
一个人的身影
一个人的身影 2020-11-22 03:40

I\'m trying to apply a gradient to a border, I thought it was as simple as doing this:

border-color: -moz-linear-gradient(top, #555555, #111111);
         


        
17条回答
  •  南笙
    南笙 (楼主)
    2020-11-22 04:21

    border-image-slice will extend a CSS border-image gradient

    This (as I understand it) prevents the default slicing of the "image" into sections - without it, nothing appears if the border is on one side only, and if it's around the entire element four tiny gradients appear in each corner.

      border-bottom: 6px solid transparent;
      border-image: linear-gradient(to right, red , yellow);
      border-image-slice: 1;
    

提交回复
热议问题