在看這個屬性時,好像國內的文章都沒給大家說太明白,今天就一起說說
首先來一個素材圖片whiteButton.png
然後我們要做成這樣的效果:
代碼(呵呵!請不要急,繼續向下看):
-moz-border-image: url(images/whiteButton.png) 0 12 0 12 round stretch;
border-image: url(images/whiteButton.png) 0 12 0 12 stretch stretch;
display: block;
width:600px;
border-width:0 12px;
padding:10px;
text-align: center;
font-size: 16px;
text-decoration: inherit;
<div style="-webkit-border-image: url(images/whiteButton.png) 0 12 0 12 stretch stretch; -moz-border-image: url(images/whiteButton.png) 0 12 0 12 round stretch; border-image: url(images/whiteButton.png) 0 12 0 12 stretch stretch; display: block; width:600px; border-width:0 12px; padding:10px; text-align: center; font-size: 16px; text-decoration: inherit; color:white;+color:black;">在safari3+和FF3.5,chrome5.0+,opera10.53浏覽器裡能看到邊框背景圖</div>
下面我們來講一下基本知識:
一。定義: border-image : none | <image> [ <number> | <percentage>]{1,4} [ / <border-width>{1,4} ]? [ stretch | repeat | round ]{0,2}