css3 border-image's transparent png issue

后端 未结 2 941
野趣味
野趣味 2021-01-15 02:36

I\'m using border-image with a PNG image that has a transparent section. The issue is that the div has background-color set the black. When I apply

相关标签:
2条回答
  • 2021-01-15 02:43

    You can set background-clip to padding-box to set background color size to padding box without border:

    -moz-background-clip: padding;
    -webkit-background-clip: padding;
    background-clip: padding-box;
    

    See http://css-tricks.com/transparent-borders-with-background-clip/ for more informations.

    0 讨论(0)
  • 2021-01-15 02:51

    Put the border on a wrapper with transparent background.

    <div id="HeaderBorder">
        <header>
            ...
        </header>
    </div>
    
    <style type="text/css">
        #HeaderBorder { /* border image stuff + transparent background */ }
    </style>
    
    0 讨论(0)
提交回复
热议问题