实例代码“Ctrl+/”提示“F11/ESC”全屏 返回 格式化 恢复 运行
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<style> 
5
div
6
{
7
border:15px solid transparent;
8
width:250px;
9
padding:10px 20px;
10
}
11
12
#round
13
{
14
-webkit-border-image:url(border.png) 30 30 round; /* Safari 5 and older */
15
-o-border-image:url(border.png) 30 30 round; /* Opera */
16
border-image:url(border.png) 30 30 round;
17
}
18
19
#stretch
20
{
21
-webkit-border-image:url(border.png) 30 30 stretch; /* Safari 5 and older */
22
-o-border-image:url(border.png) 30 30 stretch; /* Opera */
23
border-image:url(border.png) 30 30 stretch;
24
}
25
</style>
26
</head>
27
<body>
28
29
<p><b>注意: </b> Internet Explorer 不支持 border-image 属性。</p>
30
<p> border-image 属性用于设置图片的边框。</p>
31
32
<div id="round">这里,图像平铺(重复)来填充该区域。</div>
33
<br>
34
<div id="stretch">这里,图像被拉伸以填充该区域。</div>
35
36
<p>这是我们使用的图片素材:</p>
37
<img src="/upload/love/css.gif" />
38
39
</body>
40
</html>
41