border-image-source属性指定要使用的图像,而不是由border-style属性设置的边框样式。

border-image-source属性怎么用-LMLPHP

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属性怎么用-LMLPHP

以上就是border-image-source属性怎么用的详细内容,更多请关注Work网其它相关文章!

09-17 03:07