Is it possible to make a gradient border?

前端 未结 12 1109
陌清茗
陌清茗 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:48

    may be other work for you but i have very simple tips for you just replace background-image to border-image like

    background-image: -webkit-gradient( linear, left bottom, left top, color-stop(0.10, #124f7e), color-stop(0.90, #3b89c5) );
    background-image: -moz-linear-gradient(center bottom, #124f7e 10%,#3b89c5 90% );
    background-image: -o-linear-gradient(90deg,rgb(18,79,126),rgb(59,137,197));
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#3b89c5', endColorstr='#124f7e'); /* for IE */
    background-color:#124f7e;
    
    border-image: -webkit-gradient( linear, left bottom, left top, color-stop(0.10, #124f7e), color-stop(0.90, #3b89c5) );
    border-image: -moz-linear-gradient(center bottom, #124f7e 10%,#3b89c5 90% );
    border-image: -o-linear-gradient(90deg,rgb(18,79,126),rgb(59,137,197));
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#3b89c5', endColorstr='#124f7e'); /* for IE */
    border-color:#124f7e;
    

提交回复
热议问题