--- title: background-color slug: Web/CSS/background-color tags: - CSS - 'CSS:Referencias' - Todas_las_Categorías translation_of: Web/CSS/background-color ---
Background-color es un propiedad de CSS que define el color de fondo de un elemento, puede ser el valor de un color o la palabra "transparente".
background-color: color | transparent | inherit
background-color) es transparente tomando así el color del elemento que está justo debajo de él en el apilamiento.<div class="exampleone"> Lorem ipsum dolor sit amet, consectetuer </div> <div class="exampletwo"> Lorem ipsum dolor sit amet, consectetuer </div> <div class="examplethree"> Lorem ipsum dolor sit amet, consectetuer </div>
.exampleone {
background-color: teal;
color: white;
}
.exampletwo {
background-color: rgb(153,102,153);
color: rgb(255,255,204);
}
.examplethree {
background-color: #777799;
color: #FFFFFF;
}
{{EmbedLiveSample("Ejemplos","200","150")}}
(Add links to good colour reference sites here.)
TBD: This may be removed in favour of a centralized compatibility chart.
| Navegador | soporta background-color |
|---|---|
| Internet Explorer 6 | parcialmente |
| Internet Explorer 7 | parcialmente |
| Firefox 1.5 | Sí |
| Firefox 2 | Sí |
| Opera 8.5 | parcialmente |
| Opera 9 | parcialmente |
| Konqueror 3.5 | Sí |
| Safari 2 | Sí |
{{ Cssxref("background") }}, {{ Cssxref("background-attachment") }}, {{ Cssxref("background-color") }}, {{ Cssxref("background-image") }}, {{ Cssxref("background-position") }}, {{ Cssxref("background-repeat") }}