right border gradient

前端 未结 2 1302
伪装坚强ぢ
伪装坚强ぢ 2021-01-19 16:30

I am trying to make right border of an

    element to be linear gradient.
    I have tried following but with no success:

    -webkit-border-         
    
    
            
2条回答
  •  爱一瞬间的悲伤
    2021-01-19 17:01

    If anybody is interested, this is how I applied a right border gradient on a div where the top and bottom ends fade out. Seems like it took forever to figure out... This is only for Safari as doing the same thing in Firefox is a lot easier...

    http://jsfiddle.net/fkFec/1102/

    bla
    .g { border-right-width:1px; -webkit-border-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(0, transparent), color-stop(0.5, grey), color-stop(0.5, grey), color-stop(1, transparent)) 0 100%; border-right-width: 1px; border-left-width: 0px; border-top-width: 0px; border-bottom-width: 0px; padding: 2px; width: 400px; height: 150px; margin: 10px auto; }

提交回复
热议问题