📜  css 边框顶部线性渐变 - CSS 代码示例

📅  最后修改于: 2022-03-11 14:47:49.079000             🧑  作者: Mango

代码示例1
.bordertest {
    height:300px;
    width:300px;
    border-top:30px solid #c4268c;
    background:#000;
    position:relative;
    margin:1em;
}
.bordertest:first-child:before {
    content:'';
    position:absolute;
    width:100%;
    height:30px;
    background:linear-gradient(to left, #c4268c, #9a0b72);
    top:-30px;
    left:0;
}