“Fade” borders in CSS

后端 未结 5 2013
盖世英雄少女心
盖世英雄少女心 2020-12-24 07:07

I\'m using border-left: groove on an element but I want the border to \"fade\" into the background as it\'s about to end at the bottom.

I hope I\'m mak

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-24 07:27

    Add this class css to your style sheet

    .border_gradient {
    border: 8px solid #000;
    -moz-border-bottom-colors:#897048 #917953 #a18a66 #b6a488 #c5b59b #d4c5ae #e2d6c4 #eae1d2;
    -moz-border-top-colors:#897048 #917953 #a18a66 #b6a488 #c5b59b #d4c5ae #e2d6c4 #eae1d2;
    -moz-border-left-colors:#897048 #917953 #a18a66 #b6a488 #c5b59b #d4c5ae #e2d6c4 #eae1d2;
    -moz-border-right-colors:#897048 #917953 #a18a66 #b6a488 #c5b59b #d4c5ae #e2d6c4 #eae1d2;
    padding: 5px 5px 5px 15px;
    width: 300px;
    }
    

    set width to the width of your image. and use this html for image

    though it may not give the same exact border, it will some gradient looks on the border.

    source: CSS3 Borders

提交回复
热议问题