欢迎来到DIVCSS5查找CSS资料与学习DIV CSS布局技术!
  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>







本文转载自中文网

 

如需转载,请注明文章出处和来源网址:http://www.divcss5.com/css3-style/c56287.shtml