小编给大家分享一下css中border-image-source属性的使用方法,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!
css border-image-source属性用于指定要使用的图像,从而替代border-style属性中设置的边框样式。但当属性值为 "none",或者如果图像无法显示时,则还需使用边框样式。
css border-image-source属性怎么用?
border-image-source属性规定要使用的图像,从而替代border-style属性中设置的边框样式。
语法:
border-image-source: none|image;
属性值:
● none:不使用图像。
● image:用作边框的图像的路径,使用url()包含。
注释:如果值为 "none",或者如果图像无法显示,则使用边框样式。
css border-image-source属性 语法
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
div {
border: 30px solid transparent;
width: 200px;
height: 50px;
border-image-source: url('https://img.php.cn/upload/article/000/000/024/5c62637b1a4fe853.png');
border-image-repeat: round;
border-image-slice:30;
}
</style>
</head>
<body>
<div>DIV 使用图像边框</div>
<p>使用的图片:</p>
<img src="https://img.php.cn/upload/article/000/000/024/5c62637b1a4fe853.png">
</body>
</html>
效果图:

以上是css中border-image-source属性的使用方法的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注天达云行业资讯频道!