Is it possible to make a gradient border?

前端 未结 12 1107
陌清茗
陌清茗 2020-12-16 16:54

As the title states, is it possible to make a gradient border in CSS3 and if so how? I know that you can make gradient backgrounds and there are many generators for that, bu

12条回答
  •  太阳男子
    2020-12-16 17:42

    Here is a possibility to create a gradient shadow border with CSS3:

    -webkit-border-radius: 10px;
       -moz-border-radius: 10px;
        -ms-border-radius: 10px;
            border-radius: 10px;
    
    border: 4px solid rgba(0,0,0,.5);
    -webkit-box-shadow: inset 0 0 20px #000;
       -moz-box-shadow: inset 0 0 20px #000;
        -ms-box-shadow: inset 0 0 20px #000;
            box-shadow: inset 0 0 20px #000;
    

    Practically this will create an inner shadow border with 10px radius at the edges.

提交回复
热议问题