diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:41:45 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:41:45 -0500 |
commit | 1109132f09d75da9a28b649c7677bb6ce07c40c0 (patch) | |
tree | 0dd8b084480983cf9f9680e8aedb92782a921b13 /files/es/web/css/universal_selectors/index.html | |
parent | 4b1a9203c547c019fc5398082ae19a3f3d4c3efe (diff) | |
download | translated-content-1109132f09d75da9a28b649c7677bb6ce07c40c0.tar.gz translated-content-1109132f09d75da9a28b649c7677bb6ce07c40c0.tar.bz2 translated-content-1109132f09d75da9a28b649c7677bb6ce07c40c0.zip |
initial commit
Diffstat (limited to 'files/es/web/css/universal_selectors/index.html')
-rw-r--r-- | files/es/web/css/universal_selectors/index.html | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/files/es/web/css/universal_selectors/index.html b/files/es/web/css/universal_selectors/index.html new file mode 100644 index 0000000000..4dae987739 --- /dev/null +++ b/files/es/web/css/universal_selectors/index.html @@ -0,0 +1,106 @@ +--- +title: Selectores universales +slug: Web/CSS/Universal_selectors +tags: + - CSS + - Principiante + - Referencia CSS + - Selectores +translation_of: Web/CSS/Universal_selectors +--- +<div>{{CSSRef}}</div> + +<p>El <strong>selector universal</strong> CSS (<code>*</code>) coincide con elementos de cualquier tipo.</p> + +<pre class="brush: css no-line-numbers">/* Selecciona todos los elementos */ +* { + color: green; +}</pre> + +<p>A partir de CSS3, el asterisco se puede usar en combinación con {{cssxref("CSS_Namespaces", "namespaces")}}:</p> + +<ul> + <li><code>ns|*</code> - coincide con todos los elementos en el espacio de nombres <em>ns</em></li> + <li><code>*|*</code> - coincide con todos los elementos</li> + <li><code>|*</code> - matches all elements without any declared namespace</li> +</ul> + +<h2 id="Sintaxis">Sintaxis</h2> + +<pre class="syntaxbox">* { <em>style properties</em> }</pre> + +<p>El asterisco es opcional con selectores simples. Por ejemplo, <code>*.warning</code> y <code>.warning</code> son equivalentes.</p> + +<h2 id="Ejemplos">Ejemplos</h2> + +<h3 id="CSS">CSS</h3> + +<pre class="brush: css">* [lang^=en] { + color: green; +} + +*.warning { + color: red; +} + +*#maincontent { + border: 1px solid blue; +} + +.floating { + float: left +} + +/* despejar automáticamente el siguiente hermano después de un elemento flotante */ +.floating + * { + clear: left; +} +</pre> + +<h3 id="HTML">HTML</h3> + +<pre class="brush: html"><p class="warning"> + <span lang="en-us">Un span verde</span> en un párrafo rojo.</span> +</p> +<p id="maincontent" lang="en-gb"> + <span class="warning">Un span rojo</span> en un párrafo verde.</span> +</p></pre> + +<h3 id="Resultado">Resultado</h3> + +<p>{{EmbedLiveSample('Ejemplos')}}</p> + +<h2 id="Especificaciones">Especificaciones</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Especificación</th> + <th scope="col">Estado</th> + <th scope="col">Comentarios</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('CSS4 Selectors', '#the-universal-selector', 'universal selector')}}</td> + <td>{{Spec2('CSS4 Selectors')}}</td> + <td>Ningún cambio.</td> + </tr> + <tr> + <td>{{SpecName('CSS3 Selectors', '#universal-selector', 'universal selector')}}</td> + <td>{{Spec2('CSS3 Selectors')}}</td> + <td>Define el comportamiento con respecto a los espacios de nombres y agrega la sugerencia de que se permite omitir el selector dentro de los pseudo-elementos.</td> + </tr> + <tr> + <td>{{SpecName('CSS2.1', 'selector.html#universal-selector', 'universal selector')}}</td> + <td>{{Spec2('CSS2.1')}}</td> + <td>Definición Inicial.</td> + </tr> + </tbody> +</table> + +<h2 id="Compatibilidad_con_navegadores">Compatibilidad con navegadores</h2> + + + +<p>{{Compat("css.selectors.universal")}}</p> |