本篇文章给大家分享的是有关怎么使用border-image-source属性,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。
border-image-source属性指定要使用的图像,而不是由border-style属性设置的边框样式。
CSS3 border-image-source属性
作用:规定要使用的图像,代替 border-style 属性中设置的边框样式。
语法:
border-image-source: none|image;
none:表示不使用图像。
image:表示用作边框的图像的路径。
说明:如果值为 "none",或者如果图像无法显示,则使用边框样式。
CSS3 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>
</body>
</html>
效果图:

以上就是怎么使用border-image-source属性,小编相信有部分知识点可能是我们日常工作会见到或用到的。希望你能通过这篇文章学到更多知识。更多详情敬请关注天达云行业资讯频道。