CSS: 代码语言:javascript 复制 .border-box { border: 4px solid transparent; border-radius: 16px; position: relative; background-color: #222; background-clip: padding-box; /*important*/ } .border-box::before { content: ''; position: absolute; top: 0; right: 0; left: 0; bottom: 0;...
1、使用 border-image css 提供了 border-image 属性用于给 border 绘制复杂图样,与 background-image 类似,我们可以在 border 中展示image和linear-gradient。 通过border-image 设置渐变色 border 是最简单的方法,只需要两行代码: CSS: div { border: 4px solid; border-image: linear-gradient(to right, #8f4...
border-image: border-image-source:linear-gradient(to left,rgb(116,58,213),rgb(213,58,157));border-image-slice:100%;border-image-width:1;border-image-outset:0;border-image-repeat: stretch;border:10pxsolid;border-top-color: initial;border-top-style: solid;border-top-width:5px;border-right...
border-image-source:linear-gradient(to left,rgb(116,58,213),rgb(213,58,157)); border-image-slice:100%; border-image-width:1; border-image-outset:0; border-image-repeat:stretch; border:10pxsolid; border-top-color:initial; border-top-style:solid; border-top-width:5px; border-right-color...
CSS: .border-box {border: 4px solid transparent;border-radius: 16px;position: relative;background-color: #222;background-clip: padding-box; /*important*/} .border-box::before {content: '';position: absolute;top: 0;right: 0;left:...
CSS: .border-box{border:4pxsolid transparent;border-radius:16px;position: relative;background-color:#222;background-clip: padding-box;/*important*/}.border-bg{position: absolute;top:0;right:0;left:0;bottom:0;z-index: -1;margin: -4px;border-radius: inherit;/*important*/background:linear-...
border: solid 1px #999; border-radius: 5px; background: #DDD; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFF', endColorstr='#DDDDDD'); background: linear-gradient(top, #FFF, #DDD); background: -moz-linear-gradient(top, #FFF, #DDD); ...
CSS: .border-box{border:4pxsolidtransparent;border-radius:16px;position:relative;background-color:#222;background-clip:padding-box;/*important*/}.border-box::before{content:'';position:absolute;top:0;right:0;left:0;bottom:0;z-index:-1;margin:-4px;border-radius:inherit;/*important*/backgrou...
1. 使⽤border-image CSS 提供了属性⽤于给 border 绘制复杂图样,与类似,我们可以在 border 中展⽰image和linear-gradient。通过border-image设置渐变⾊ border 是最简单的⽅法,只需要两⾏代码:CSS:div { border: 4px solid;border-image: linear-gradient(to right, #8f41e9, #578aef) 1;} /...
CSS: .border-box { border: 4px solid transparent; border-radius: 16px; position: relative; background-color: #222; background-clip: padding-box; /*important*/ } .border-box::before { content: ''; position: absolute; top: 0; right: 0; left: 0; bottom: 0; z-index: -1; margin...