溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

css中的border-image屬性怎么用

發(fā)布時(shí)間:2022-02-25 13:45:27 來源:億速云 閱讀:234 作者:小新 欄目:web開發(fā)

這篇文章主要為大家展示了“css中的border-image屬性怎么用”,內(nèi)容簡而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領(lǐng)大家一起研究并學(xué)習(xí)一下“css中的border-image屬性怎么用”這篇文章吧。

  CSS3border-image屬性

  作用:使用圖片來創(chuàng)建邊框

  說明:復(fù)合屬性。設(shè)置或檢索對象的邊框樣式使用圖像來填充??梢砸淮涡栽O(shè)置:border-image-source,border-image-slice,border-image-width,border-image-outset和border-image-repeat屬性的值。

  語法:

  border-image:sourceslicewidthoutsetrepeat|initial|inherit;

  參數(shù):

  border-image-source:用于指定要用于繪制邊框的圖像的位置。

  border-image-slice:圖像邊界向內(nèi)偏移。

  border-image-width:圖像邊界的寬度。

  border-image-outset:用于指定在邊框外部繪制border-image-area的量。

  border-image-repeat:用于設(shè)置圖像邊界是否應(yīng)重復(fù)(repeat)、拉伸(stretch)或鋪滿(round)。

  css3border-image屬性使用示例

  <!DOCTYPEhtml>

  <html>

  <head>

  <style>

  div

  {

  border:15pxsolidtransparent;

  width:300px;

  padding:10px20px;

  }

  #round

  {

  -moz-border-image:url(https://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg)3030round;/*OldFirefox*/

  -webkit-border-image:url(https://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg)3030round;/*SafariandChrome*/

  -o-border-image:url(https://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg)3030round;/*Opera*/

  border-image:url(https://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg)3030round;

  }

  #stretch

  {

  -moz-border-image:url(https://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg)3030stretch;/*OldFirefox*/

  -webkit-border-image:url(https://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg)3030stretch;/*SafariandChrome*/

  -o-border-image:url(https://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg)3030stretch;/*Opera*/

  border-image:url(https://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg)3030stretch;

  }

  </style>

  </head>

  <body>

  <divid="round">在這里,圖片鋪滿整個(gè)邊框。</div>

  <br>

  <divid="stretch">在這里,圖片被拉伸以填充該區(qū)域。</div>

  <p>這是我們使用的圖片:</p>

  <imgsrc="https://img.php.cn/upload/article/000/000/024/5c513adf97e86533.jpg">

  <p><b>注釋:</b>InternetExplorer不支持border-image屬性。</p>

  <p>border-image屬性規(guī)定了用作邊框的圖片。</p>

  </body>

  </html>


css中的border-image屬性怎么用


以上是“css中的border-image屬性怎么用”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對大家有所幫助,如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

css
AI