background-color

  • Revision slug: CSS/background-color
  • Revision title: background-color
  • Revision id: 111042
  • Created:
  • Creator: Verruckt
  • Is current revision? Não
  • コメント

Revision Content

{{template.CSSRef()}}

Resumo

background-color sets the background color of an element, either through a color value or the keyword transparent.

  • Valor inicial: transparent
  • Aplica-se a: all elements
  • Herança: no
  • Porcentagens: N/A
  • Mídia: visual
  • Valor computado: as specified

Sintaxe

background-color: color | transparent | inherit

Valores

color 
The color can be specified as a hexidecimal RGB value, a regular RGB value, or by using one of the pre-defined color keywords.
transparent 
The default value for background-color is transparent meaning the element has no color of its own, instead showing the color of the element behind it.

Exemplos

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

.exampleone {
	background-color: teal;
	color: white;
}

.exampletwo {
	background-color: rgb(153,102,153);
	color: rgb(255,255,204);
}

.examplethree {
	background-color: #666699;
	color: #FFFFFF;
}

Notas

(Add links to good colour reference sites here.)

Especificações

Compatibilidade com navegadores

TBD: This may be removed in favour of a centralized compatibility chart.

Veja também

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

Categorias

Interwiki Language Links

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

Revision Source

<p>
{{template.CSSRef()}}
</p>
<h3 name="Resumo"> Resumo </h3>
<p><code>background-color</code> sets the background color of an element, either through a color value or the keyword <code>transparent</code>.
</p>
<ul><li> Valor inicial: transparent
</li><li> Aplica-se a: all elements
</li><li> Herança: no
</li><li> Porcentagens: N/A
</li><li> Mídia: <a href="pt/CSS/Media/Visual">visual</a>
</li><li> Valor computado: as specified
</li></ul>
<h3 name="Sintaxe"> Sintaxe </h3>
<pre class="eval">background-color: <i>color</i> | transparent | inherit
</pre>
<h3 name="Valores"> Valores </h3>
<dl><dt> color </dt><dd> The color can be specified as a hexidecimal RGB value, a regular RGB value, or by using one of the pre-defined color keywords.
</dd><dt> transparent </dt><dd> The default value for <code>background-color</code> is <code>transparent</code> meaning the element has no color of its own, instead showing the color of the element behind it.
</dd></dl>
<h3 name="Exemplos"> Exemplos </h3>
<p>{{template.CSSRefExampleLink("background-color")}}
</p>
<pre>.exampleone {
	background-color: teal;
	color: white;
}

.exampletwo {
	background-color: rgb(153,102,153);
	color: rgb(255,255,204);
}

.examplethree {
	background-color: #666699;
	color: #FFFFFF;
}

</pre>
<h3 name="Notas"> Notas </h3>
<p>(Add links to good colour reference sites here.)
</p>
<h3 name="Especifica.C3.A7.C3.B5es"> Especificações </h3>
<ul><li> <a class="external" href="http://www.w3.org/TR/CSS1#background-color">CSS 1</a>
</li><li> <a class="external" href="http://www.w3.org/TR/CSS21/colors.html#propdef-background-color">CSS 2.1</a>
</li><li> <a class="external" href="http://www.w3.org/TR/2005/WD-css3-background-20050216/#background-color">CSS 3</a>
</li></ul>
<h3 name="Compatibilidade_com_navegadores"> Compatibilidade com navegadores </h3>
<p>TBD: This may be removed in favour of a centralized compatibility chart.
</p>
<h3 name="Veja_tamb.C3.A9m"> Veja também </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( { "en": "en/CSS/background-color", "fr": "fr/CSS/background-color", "pl": "pl/CSS/background-color" } ) }}
Revert to this revision