border-image-source

  • Revision slug: CSS/border-image-source
  • Revision title: border-image-source
  • Revision id: 41661
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment 6 words added

Revision Content

{{ CSSRef() }}

The border-image-source CSS property defines the {{ xref_cssimage() }} to use instead of the style of the border. If this property is set to none, the style defined by {{ cssxref("border-style") }} is used instead.

Though any {{ xref_cssimage() }} can be used with this CSS property, browser-support is still limited and some of them supports only images defined using the url() functional notation.
  • {{ Xref_cssinitial() }}: 1
  • Applies to: all elements, except internal table elements when {{ cssxref("border-collapse") }} is set to collapse.
  • {{ Xref_cssinherited() }}: no
  • Media: {{ Xref_cssvisual() }}
  • {{ Xref_csscomputed() }}: none, or the image with its URI made absolute.
  • Animatable: no

Syntax

Formal grammar: none | <image> 
border-image-source: none                                  /* no border-image, use the specified border-style */
border-image-source: url(image.jpg)                        /* the image.jpg is used as image */
border-image-source: linear-gradient(to top, red, yellow)  /* a gradient is used as image */

border-image-source: inherit

Specifications

Specification Status Comment
CSS Backgrounds and Borders Module Level 3 {{ Spec2('CSS3 Backgrounds') }} Initial specification

Browser compatibility

{{ CompatibilityTable() }}

Feature Firefox (Gecko) Chrome Internet Explorer Opera Safari
Basic support {{ CompatGeckoDesktop("11.0") }} 15.0 {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}
Feature Firefox Mobile (Gecko) Android IE Phone Opera Mobile Safari Mobile
Basic support {{ CompatGeckoMobile("11.0") }} {{ CompatUnknown() }} {{ CompatNo() }} {{ CompatUnknown() }} {{ CompatUnknown() }}

See also

  • {{ CSS_border_image() }}

Revision Source

<p>{{ CSSRef() }}</p>
<p>The <code>border-image-source</code> CSS property defines the {{ xref_cssimage() }} to use instead of the style of the border. If this property is set to <code>none</code>, the style defined by {{ cssxref("border-style") }} is used instead.</p>
<div class="note">Though any {{ xref_cssimage() }} can be used with this CSS property, browser-support is still limited and some of them supports only images defined using the <code>url()</code> functional notation.</div>
<ul class="cssprop" style="display:table;padding: 0.4em;border-left:0.15em solid;background-color:#eeeeff"> <li style="display:table-row;padding: 3px;margin:0;"><dfn style="display:table-cell;padding: 0 5px;border-bottom: none;cursor:inherit;">{{ Xref_cssinitial() }}:</dfn> <code>1</code></li> <li style="display:table-row;padding: 3px;margin:0;"><dfn style="display:table-cell;padding: 0 5px;border-bottom: none;cursor:inherit;">Applies to:</dfn> all elements, except internal table elements when {{ cssxref("border-collapse") }} is set to <code>collapse</code>.</li> <li style="display:table-row;padding: 3px;margin:0;"><dfn style="display:table-cell;padding: 0 5px;border-bottom: none;cursor:inherit;">{{ Xref_cssinherited() }}:</dfn> no</li> <li style="display:table-row;padding: 3px;margin:0;"><dfn style="display:table-cell;padding: 0 5px;border-bottom: none;cursor:inherit;">Media:</dfn> {{ Xref_cssvisual() }}</li> <li style="display:table-row;padding: 3px;margin:0;"><dfn style="display:table-cell;padding: 0 5px;border-bottom: none;cursor:inherit;">{{ Xref_csscomputed() }}:</dfn> <code>none</code>, or the image with its URI made absolute.</li> <li style="display:table-row;padding: 3px;margin:0;"><dfn style="display:table-cell;padding: 0 5px;border-bottom: none;cursor:inherit;">Animatable:</dfn> no</li>
</ul>
<h2>Syntax</h2>
<pre class="eval syntaxbox" style="border:1px solid #cccccc;border-bottom: none; margin-bottom:0;background-color:#ffe;border-top-right-radius:1em;border-top-left-radius:1em;">Formal grammar: none | &lt;image&gt; 
</pre>
<pre style="border:1px solid #cccccc;border-bottom-right-radius:1em;border-bottom-left-radius:1em;border-top:none;margin-top:0;">border-image-source: none                                  /* no border-image, use the specified border-style */
border-image-source: url(image.jpg)                        /* the image.jpg is used as image */
border-image-source: linear-gradient(to top, red, yellow)  /* a gradient is used as image */

border-image-source: inherit
</pre>
<h2 name="Specifications">Specifications</h2>
<table class="standard-table"> <thead> <tr style="background-color: rgb(255, 204, 255);"> <th scope="col">Specification</th> <th scope="col">Status</th> <th scope="col">Comment</th> </tr> </thead> <tbody> <tr> <td><a class="external" href="http://dev.w3.org/csswg/css3-background/#the-border-image-source" title="http://dev.w3.org/csswg/css3-background/#the-border-image-source">CSS Backgrounds and Borders Module Level 3</a></td> <td>{{ Spec2('CSS3 Backgrounds') }}</td> <td>Initial specification</td> </tr> </tbody>
</table>
<h2>Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop"> <table class="compat-table"> <tbody> <tr> <th>Feature</th> <th>Firefox (Gecko)</th> <th>Chrome</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td>{{ CompatGeckoDesktop("11.0") }}</td> <td>15.0</td> <td>{{ CompatNo() }}</td> <td>{{ CompatNo() }} <a class="external" href="http://www.opera.com/docs/specs/presto2.10/css/backgroundsborders/" title="http://www.opera.com/docs/specs/presto2.10/css/backgroundsborders/"></a></td> <td>{{ CompatNo() }}</td> </tr> </tbody> </table>
</div>
<div id="compat-mobile"> <table class="compat-table"> <tbody> <tr> <th>Feature</th> <th>Firefox Mobile (Gecko)</th> <th>Android</th> <th>IE Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td>{{ CompatGeckoMobile("11.0") }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatNo() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> </tr> </tbody> </table>
</div>
<h3>See also</h3>
<ul> <li>{{ CSS_border_image() }}</li>
</ul>
Revert to this revision