Gradient borders

后端 未结 17 1424
一个人的身影
一个人的身影 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:25

    I agree with szajmon. The only problem with his and Quentin's answers is cross-browser compatibility.

    HTML:

    bla

    CSS:

    .g {
    background-image: -webkit-linear-gradient(300deg, white, black, white); /* webkit browsers (Chrome & Safari) */
    background-image: -moz-linear-gradient(300deg, white, black, white); /* Mozilla browsers (Firefox) */
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#000000', gradientType='1'); /* Internet Explorer */
    background-image: -o-linear-gradient(300deg,rgb(255,255,255),rgb(0,0,0) 50%,rgb(255,255,255) 100%); /* Opera */
    }
    
    .g > div { background: #fff; }
    

提交回复
热议问题