欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  web前端

border-image-source属性怎么用

程序员文章站 2022-04-25 23:37:54
...
border-image-source属性指定要使用的图像,而不是由border-style属性设置的边框样式。

border-image-source属性怎么用

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

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