使用CSS将图像设置为边框
CSSborder-image属性用于将图像边框添加到某些元素。您可以尝试运行以下代码以将图像设置为元素的边框:
示例
<html>
<head>
<style>
#borderimg1 {
border: 10px solid transparent;
padding: 15px;
border-image-source: url(/css/images/border.png);
border-image-repeat: round;
border-image-slice: 30;
border-image-width: 10px;
}
#borderimg2 {
border: 10px solid transparent;
padding: 15px;
border-image-source: url(/css/images/border.png);
border-image-repeat: round;
border-image-slice: 30;
border-image-width: 20px;
}
#borderimg3 {
border: 10px solid transparent;
padding: 15px;
border-image-source: url(/css/images/border.png);
border-image-repeat: round;
border-image-slice: 30;
border-image-width: 30px;
}
</style>
</head>
<body>
<p id = "borderimg1">This is image border example.</p>
<p id = "borderimg2">This is image border example.</p>
<p id = "borderimg3">This is image border example.</p>
</body>
</html>热门推荐
10 分手快乐祝福语简短
11 儿子31岁祝福语简短
12 妈妈生日祝福语简短温暖
13 七一祝福语明信片文案简短
14 工人生日祝福语简短
15 简短新婚铺被子祝福语
16 二胎祝福语简短霸气
17 新年祝福语简短创意兄弟
18 祝福语简短唯美10字