From a55b575e8089ee6cab7c5c262a7e6db55d0e34d6 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 14:46:50 +0100 Subject: unslug es: move --- .../css/selectores_hermanos_adyacentes/index.html | 135 --------------------- 1 file changed, 135 deletions(-) delete mode 100644 files/es/web/css/selectores_hermanos_adyacentes/index.html (limited to 'files/es/web/css/selectores_hermanos_adyacentes/index.html') diff --git a/files/es/web/css/selectores_hermanos_adyacentes/index.html b/files/es/web/css/selectores_hermanos_adyacentes/index.html deleted file mode 100644 index 1200c4bd61..0000000000 --- a/files/es/web/css/selectores_hermanos_adyacentes/index.html +++ /dev/null @@ -1,135 +0,0 @@ ---- -title: Selectores de hermanos adyacentes -slug: Web/CSS/Selectores_hermanos_adyacentes -tags: - - CSS - - NeedsMobileBrowserCompatibility - - Referencia CSS - - Selectores -translation_of: Web/CSS/Adjacent_sibling_combinator ---- -

{{CSSRef("Selectors")}}

- -

Se hace referencia a este selector como selector adyacente o selector del próximo hermano. Sólo seleccionará un elemento especificado que esté inmediatamente después de otro elemento especificado.

- -

Sintaxis

- -
elemento_anterior + elemento_afectado { estilos }
-
- -

Ejemplo

- -
-
li:first-of-type + li {
-  color: red;
-}
-
- -
<ul>
-  <li>Uno</li>
-  <li>Dos</li>
-  <li>Tres</li>
-</ul>
-
- -

{{EmbedLiveSample('Example_1', 200, 100)}}

- -

Otro caso podría ser dar estilos a un span que se use de pie de foto de los siguientes elementos {{HTMLElement("img")}} :

- -
img + span.caption {
-  font-style: italic;
-}
-
- -

que coincidiría con los siguientes elementos {{HTMLElement("span")}} :

- -
<img src="photo1.jpg"><span class="caption">The first photo</span>
-<img src="photo2.jpg"><span class="caption">The second photo</span>
-
- -

Especificaciones

- - - - - - - - - - - - - - - - - - - - - - - - - - -
EspecificacionEstadoComentarios
{{SpecName('CSS4 Selectors', '#adjacent-sibling-combinators', 'next-sibling combinator')}}{{Spec2('CSS4 Selectors')}} 
{{SpecName('CSS3 Selectors', '#adjacent-sibling-combinators', 'Adjacent sibling combinator')}}{{Spec2('CSS3 Selectors')}} 
{{SpecName('CSS2.1', 'selector.html#adjacent-selectors', 'Adjacent sibling selectors')}}{{Spec2('CSS2.1')}}Initial definition
- -

Compatibilidad entre navegadores

- -

{{CompatibilityTable}}

- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}7.0[1]{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - -
FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support2.1{{CompatVersionUnknown}}{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -

[1] Internet Explorer 7 no actualiza correctamente el estilo cuando un elemento es insertado dinámicamente antes de otro elemento que coincidía con el selector. En Internet Explorer 8, si un elemento es insertado dinámicamente haciendo click en un enlace, el estilo del first-child no se aplica hasta que el enlace pierde el foco.

- -

Ver también

- - -- cgit v1.2.3-54-g00ecf