background-clip

  • Revision slug: CSS/background-clip
  • Revision title: background-clip
  • Revision id: 6323
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment 7 words added

Revision Content

{{ CSSMozExtensionRef() }}

Summary

In Gecko-based applications like Firefox the -moz-background-clip CSS property specifies whether an element's background, either the color or image, extends underneath its border.

If there is no background-image, this property has only visual effect when the border has transparent regions (because of {{ Cssxref("border-style") }}) or partially opaque regions; otherwise the border covers up the difference.

  • {{ Xref_cssinitial() }}: border
  • Applies to: all elements
  • {{ Xref_cssinherited() }}: no
  • Media: {{ Xref_cssvisual() }}
  • {{ Xref_csscomputed() }}: as specified

Syntax

-moz-background-clip:  [border | padding][, [border | padding]]*

Values

border
The background extends to the outside edge of the border (but underneath the border in z-ordering).
Default value, but see {{ anch("Browser compatibility") }} section below for special case Internet Explorer 7.
padding
No background is drawn below the border (background extends to the outside edge of the padding).

Examples

 pre {
   border: 1em navy;
   border-style: dotted double;
   background: tomato;
   /* The red background will not go behind the border */
      -moz-background-clip: padding;
   -webkit-background-clip: padding;
 }

Browser compatibility

Browser Lowest version Support of
Internet Explorer --- --- [*]
Firefox (Gecko) 1.0 (1.2) -moz-background-clip: padding | border
Opera --- ---
Safari (WebKit) 3.0 (522) -webkit-background-clip: padding | border | content
  • [*]  IE 7 (not other versions of IE) behaves like background-clip:padding if overflow: hidden | auto | scroll.
  • Safari/Webkit supports also the synonym values  border-box | padding-box | content-box.
  • Konqueror 3.5.4 supports -khtml-background-clip.

Specifications

See also

  • {{ cssxref("-moz-background-size") }}, {{ cssxref("-moz-background-origin") }}
  • {{ CSS_Reference:Background() }}
  • {{ cssxref("clip") }}

{{ languages( { "fr": "fr/CSS/-moz-background-clip", "ja": "ja/CSS/-moz-background-clip", "pl": "pl/CSS/-moz-background-clip" } ) }}

Revision Source

<p>{{ CSSMozExtensionRef() }}</p>
<h3>Summary</h3>
<p>In <a href="/en/Gecko" title="en/Gecko">Gecko</a>-based applications like Firefox the<code> -moz-background-clip </code>CSS property specifies whether an element's background, either the color or image, extends underneath its border.</p>
<p>If there is no background-image, this property has only visual effect when the border has transparent regions (because of {{ Cssxref("border-style") }}) or partially opaque regions; otherwise the border covers up the difference.</p>
<ul> <li>{{ Xref_cssinitial() }}:<code> border</code></li> <li>Applies to: all elements</li> <li>{{ Xref_cssinherited() }}: no</li> <li>Media: {{ Xref_cssvisual() }}</li> <li>{{ Xref_csscomputed() }}: as specified</li>
</ul>
<h3>Syntax</h3>
<pre>-moz-background-clip:  [border | padding][, [border | padding]]*
</pre>
<h3>Values</h3>
<dl> <dt>border</dt> <dd>The background extends to the outside edge of the border (but underneath the border in z-ordering).<br> Default value, but see {{ anch("Browser compatibility") }} section below for special case Internet Explorer 7.</dd> <dt>padding</dt> <dd>No background is drawn below the border (background extends to the outside edge of the padding).</dd>
</dl>
<h3>Examples</h3>
<pre style="overflow:visible; border:1em navy; border-style:dotted double; background:tomato; -moz-background-clip:padding; -webkit-background-clip:padding;"> pre {
   border: 1em navy;
   border-style: dotted double;
   background: tomato;
   /* The red background will not go behind the border */
      -moz-background-clip: padding;
   -webkit-background-clip: padding;
 }
</pre>
<h3>Browser compatibility</h3>
<table class="standard-table"> <tbody> <tr> <th>Browser</th> <th>Lowest version</th> <th>Support of</th> </tr> <tr> <td>Internet Explorer</td> <td>---</td> <td>--- [*]</td> </tr> <tr> <td>Firefox (Gecko)</td> <td>1.0 (1.2)</td> <td><code>-moz-background-clip: padding | border</code></td> </tr> <tr> <td>Opera</td> <td>---</td> <td>---</td> </tr> <tr> <td>Safari (WebKit)</td> <td>3.0 (522)</td> <td><code>-webkit-background-clip: padding | border | content</code></td> </tr> </tbody>
</table>
<ul> <li>[*]  IE 7 (not other versions of IE) behaves like<code> background-clip:padding </code>if<code> overflow: hidden | auto | scroll</code>.</li> <li>Safari/Webkit supports also the synonym values <code> border-box | padding-box | content-box</code>.</li> <li>Konqueror 3.5.4 supports<code> -khtml-background-clip</code>.</li>
</ul>
<h3>Specifications</h3>
<ul> <li><a class="external" href="http://www.w3.org/TR/css3-background/#the-background-clip" title="http://www.w3.org/TR/css3-background/#the-background-clip">CSS 3 Backgrounds and Borders #background-clip</a> Working draft, not yet implemented.<br> Specifies the values<code> border-box | padding-box </code>(<code>content-box </code>is dropped).</li>
</ul>
<h3>See also</h3>
<ul> <li>{{ cssxref("-moz-background-size") }}, {{ cssxref("-moz-background-origin") }}</li> <li>{{ CSS_Reference:Background() }}</li> <li>{{ cssxref("clip") }}</li>
</ul>
<p>{{ languages( { "fr": "fr/CSS/-moz-background-clip", "ja": "ja/CSS/-moz-background-clip", "pl": "pl/CSS/-moz-background-clip" } ) }}</p>
Revert to this revision