aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/css/border-image-source/index.html
blob: 32b7b3bfa6b9a97034578f20ce487a3cc1bf818f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
title: border-image-source
slug: Web/CSS/border-image-source
translation_of: Web/CSS/border-image-source
---
<div>{{CSSRef}}</div>

<h2 id="Summary">Summary</h2>

<p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS">CSS</a> 属性 <strong><code>border-image-source</code></strong>  用于声明元素的<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/border-image">边框图片(border-image)</a>的资源 </p>

<p>{{EmbedInteractiveExample("pages/css/border-image-source.html")}}</p>

<p>属性 {{cssxref("border-image-slice")}} 被用于切割资源图片的区域,然后将其动态的应用到最终的边框图片</p>

<h2 id="Syntax">Syntax</h2>

<pre class="brush:css">/* no border-image, use the specified border-style */
border-image-source: none;

/* the image.jpg is used as image */
border-image-source: url(image.jpg);

/* a gradient is used as image */
border-image-source: linear-gradient(to top, red, yellow);

/* Global values */
border-image-source: inherit;
border-image-source: initial;
border-image-source: unset;
</pre>

<h3 id="Values">Values</h3>

<dl>
 <dt><code>none</code></dt>
 <dd>不会使用图片边框。会被{{cssxref("border-style")}}属性所设置的边框样式替换掉</dd>
 <dt><code>&lt;image&gt;</code></dt>
 <dd>用作边框的图片</dd>
</dl>

<h3 id="Formal_syntax">Formal syntax</h3>

{{csssyntax}}

<h2 id="Specifications" name="Specifications">Examples</h2>

<p>请查看示例 {{cssxref("border-image")}}</p>

<h2 id="Specifications" name="Specifications">Specifications</h2>



<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('CSS3 Backgrounds', '#border-image-source', 'border-image-source')}}</td>
   <td>{{Spec2('CSS3 Backgrounds')}}</td>
   <td>Initial definition</td>
  </tr>
 </tbody>
</table>



<p>{{cssinfo}}</p>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<div>{{Compat("css.properties.border-image-source")}}</div>

<div id="compat-mobile"></div>