From 1109132f09d75da9a28b649c7677bb6ce07c40c0 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:41:45 -0500 Subject: initial commit --- files/es/web/css/background-image/index.html | 135 +++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 files/es/web/css/background-image/index.html (limited to 'files/es/web/css/background-image') diff --git a/files/es/web/css/background-image/index.html b/files/es/web/css/background-image/index.html new file mode 100644 index 0000000000..b2ab46dd70 --- /dev/null +++ b/files/es/web/css/background-image/index.html @@ -0,0 +1,135 @@ +--- +title: background-image +slug: Web/CSS/background-image +tags: + - CSS + - 'CSS:Referencias' + - Todas_las_Categorías +translation_of: Web/CSS/background-image +--- +

{{ PreviousNext("CSS:background-color", "CSS:background-position") }}

+ +

Resumen

+ +

La propiedad CSS background-image establece una o más imágenes de fondo para un elemento.

+ + + +

Sintaxis

+ +
background-image: url | none | inherit
+
+ +

Valores

+ +
+
url 
+
Localización de la imagen que se utilizará de fondo.
+
none 
+
Utilizado para especificar que un elemento no debe tener ninguna imagen de fondo.
+
+ +

Ejemplos

+ +

Note that the star image is partially transparent and is layered over the cat image.

+ +

HTML

+ +
<div>
+    <p class="catsandstars">
+        This paragraph is full of cats<br />and stars.
+    </p>
+    <p>This paragraph is not.</p>
+    <p class="catsandstars">
+        Here are more cats for you.<br />Look at them!
+    </p>
+    <p>And no more.</p>
+</div>
+ +

CSS

+ +
pre, p {
+    font-size: 1.5em;
+    color: #FE7F88;
+    background-color: transparent;
+}
+
+div {
+  background-image: url("https://mdn.mozillademos.org/files/6457/mdn_logo_only_color.png");
+}
+
+p {
+  background-image: none;
+}
+
+.catsandstars {
+  background-image:  url("https://mdn.mozillademos.org/files/11991/startransparent.gif"),
+                     url("https://mdn.mozillademos.org/files/7693/catfront.png");
+  background-color: transparent;
+}
+
+ +

Result

+ +

{{EmbedLiveSample('Ejemplos')}}

+ +

Notas

+ +

Los desarrolladores deben asegurarse que han especificado un color de fondo ({{ Cssxref("background-color") }}) en el caso de no usar una imagen. Las imágenes de fondo son mostradas encima del color de fondo.

+ +

Sobre Accesibilidad

+ +

Los lectores de pantalla no reconocen las imágenes de fondo, si la imagen tiene un significado y no es de carácter meramente decorativa deberás incluirla semánticamente en el documento utilizando la etiqueta img.

+ +

Para más información (en inglés):

+ + + +

Especificaciones

+ + + +

Compatibilidad de navegador

+ + + + + + + + + + + + + + + + + + + + + + + + +
NavegadorVersión mínima
Internet Explorer4
Firefox1
Netscape4
Opera3.5
+ +

Ver también

+ +

{{ Cssxref("background") }}, {{ Cssxref("background-attachment") }}, {{ Cssxref("background-color") }}, {{ Cssxref("background-image") }}, {{ Cssxref("background-position") }}, {{ Cssxref("background-repeat") }}

-- cgit v1.2.3-54-g00ecf