萬盛學電腦網

 萬盛學電腦網 >> 網頁制作 >> DivCSS教程 >> css3 border

css3 border

class="area">

在看這個屬性時,好像國內的文章都沒給大家說太明白,今天就一起說說

首先來一個素材圖片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}

 

none:
默認值。無背景圖。
<image>
使用絕對或相對 url 地址指定背景圖像。

 

 <number>

邊框寬度用固定像素值表示。
<percentage>:
邊框寬度用百分比表示。
[ stretch | repeat | round ]:

copyright © 萬盛學電腦網 all rights reserved