background-image

  • Revision slug: CSS/background-image
  • Revision title: background-image
  • Revision id: 184483
  • Created:
  • Creator: Verruckt
  • Is current revision? Não
  • コメント New page: <breadcrumbs></breadcrumbs> {{CSSRef}} == Summary == The <code>background-image</code> property sets the background image for an element. * Initial value: none * Applies to: all elemen...

Revision Content

{{template.CSSRef()}}

Summary

The background-image property sets the background image for an element.

  • Initial value: none
  • Applies to: all elements
  • Inherited: no
  • Percentages: N/A
  • Media: visual
  • Computed value: absolute URI or none

Syntax

background-image: uri | none | inherit

Values

uri 
The location of the image resource to be used as a background image.
none 
Used to specify that an element is to have no background image.

Examples

{{template.CSSRefExampleLink("background-image")}}

body { background-image: url("images/darkpattern.png"); }

p { background-image: none; }

Notes

Developers should ensure that they specify a {{template.Cssxref("background-color")}} to be used if an image is not available. Background images are rendered on top of the background color.

Specifications

Browser Compatibility

Browser Compatibility

Browser Lowest Version
Internet Explorer 4
Firefox 1
Netscape 4
Opera 3.5

See Also

{{wiki.template('CSS_Reference:Background')}}

Categorias

Interwiki Language Links

{{ wiki.languages( { "fr": "fr/CSS/background-image", "pl": "pl/CSS/background-image" } ) }}

Revision Source

<p>
{{template.CSSRef()}}
</p>
<h3 name="Summary"> Summary </h3>
<p>The <code>background-image</code> property sets the background image for an element.  
</p>
<ul><li> Initial value: none
</li><li> Applies to: all elements
</li><li> Inherited: no
</li><li> Percentages: N/A
</li><li> Media: <a href="pt/CSS/Media/Visual">visual</a>
</li><li> Computed value: absolute URI or none
</li></ul>
<h3 name="Syntax"> Syntax </h3>
<pre class="eval">background-image: <i>uri</i> | none | inherit
</pre>
<h3 name="Values"> Values </h3>
<dl><dt> uri </dt><dd> The location of the image resource to be used as a background image.
</dd><dt> none </dt><dd> Used to specify that an element is to have no background image.
</dd></dl>
<h3 name="Examples"> Examples </h3>
<p>{{template.CSSRefExampleLink("background-image")}}
</p>
<pre>body { background-image: url("images/darkpattern.png"); }

p { background-image: none; }
</pre>
<h3 name="Notes"> Notes </h3>
<p>Developers should ensure that they specify a {{template.Cssxref("background-color")}} to be used if an image is not available.  Background images are rendered on top of the background color.
</p>
<h3 name="Specifications"> Specifications </h3>
<ul><li> <a class="external" href="http://www.w3.org/TR/CSS1#background-image">CSS 1</a>
</li><li> <a class="external" href="http://www.w3.org/TR/CSS21/colors.html#propdef-background-image">CSS 2.1</a>
</li><li> <a class="external" href="http://www.w3.org/TR/2005/WD-css3-background-20050216/#the-background-image">CSS 3</a>
</li></ul>
<h3 name="Browser_Compatibility"> Browser Compatibility </h3>
<h3 name="Browser_Compatibility_2"> Browser Compatibility </h3>
<table class="standard-table">
  <tbody><tr>
    <th>Browser</th>
    <th>Lowest Version</th>
  </tr>
  <tr>
    <td>Internet Explorer</td>
    <td>4</td>
  </tr>
  <tr>
    <td>Firefox</td>
    <td>1</td>
  </tr>
  <tr>
    <td>Netscape</td>
    <td>4</td>
  </tr>
  <tr>
    <td>Opera</td>
    <td>3.5</td>
  </tr>
</tbody></table>
<h3 name="See_Also"> See Also </h3>
<p>{{wiki.template('CSS_Reference:Background')}}
</p><p><span class="comment">Categorias</span>
</p><p><span class="comment">Interwiki Language Links</span>
</p>{{ wiki.languages( { "fr": "fr/CSS/background-image", "pl": "pl/CSS/background-image" } ) }}
Revert to this revision