css中的border-image属性怎么用(css,web开发)

时间:2024-04-28 01:41:30 作者 : 石家庄SEO 分类 : web开发
  • TAG :

  CSS3border-image属性

  作用:使用图片来创建边框

  说明:复合属性。设置或检索对象的边框样式使用图像来填充。可以一次性设置:border-image-source,border-image-slice,border-image-width,border-image-outset和border-image-repeat属性的值。

  语法:

  border-image:sourceslicewidthoutsetrepeat|initial|inherit;

  参数:

  border-image-source:用于指定要用于绘制边框的图像的位置。

  border-image-slice:图像边界向内偏移。

  border-image-width:图像边界的宽度。

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

  border-image-repeat:用于设置图像边界是否应重复(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">在这里,图片铺满整个边框。</div>

  <br>

  <divid="stretch">在这里,图片被拉伸以填充该区域。</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属性规定了用作边框的图片。</p>

  </body>

  </html>


css中的border-image属性怎么用


 </div> <div class="zixun-tj-product adv-bottom"></div> </div> </div> <div class="prve-next-news">
本文:css中的border-image属性怎么用的详细内容,希望对您有所帮助,信息来源于网络。
上一篇:css中的outline-offset属性怎么用下一篇:

6 人围观 / 0 条评论 ↓快速评论↓

(必须)

(必须,保密)

阿狸1 阿狸2 阿狸3 阿狸4 阿狸5 阿狸6 阿狸7 阿狸8 阿狸9 阿狸10 阿狸11 阿狸12 阿狸13 阿狸14 阿狸15 阿狸16 阿狸17 阿狸18