aboutsummaryrefslogtreecommitdiff
path: root/files/es/web/css/isolation/index.html
blob: 870658cc12a20998cee41cf15f97589fd54b472f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
---
title: Isolation
slug: Web/CSS/isolation
tags:
  - CSS
  - Composición CSS
  - Propieiedad CSS
translation_of: Web/CSS/isolation
---
<div>{{CSSRef}}</div>

<h2 id="Resumen">Resumen</h2>

<p>La propiedad CSS <strong><code>isolation</code></strong><code> define si el elemento debe crear un nuevo </code>{{glossary("stacking context")}}.</p>

<p>Esto es especialmente útil en conjunto con {{cssxref("background-blend-mode")}} que solo mezclan fondos en un contexto de apilamiento determinado: permite aislar grupos de elementos de sus fondos más profundos y mezclar sus colores de fondo.</p>

<p>{{cssinfo}}</p>

<h2 id="Sintaxis">Sintaxis</h2>

<pre class="brush:css">/* Keyword values */
isolation: auto;
isolation: isolate;

/* Global values */
isolation: inherit;
isolation: initial;
isolation: unset;
</pre>

<h3 id="Valores">Valores</h3>

<dl>
 <dt><code>auto</code></dt>
 <dd>Es un keyword que indica que un nuevo contexto de apilamiento debe ser creado solo si una de las propiedades aplicadas al elemento lo requiere.</dd>
 <dt><code>isolate</code></dt>
 <dd>Es un keyword que indica que un nuevo contexto de apilamiento debe ser creado.</dd>
</dl>

<h3 id="Sintaxis_formal">Sintaxis formal</h3>

{{csssyntax}}

<h2 id="Ejemplos">Ejemplos</h2>

<pre class="brush: html">&lt;div id="b" class="a"&gt;
  &lt;div id="d"&gt;
    &lt;div class="a c"&gt;auto&lt;/div&gt;
  &lt;/div&gt;
  &lt;div id="e"&gt;
    &lt;div class="a c"&gt;isolate&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</pre>

<pre class="brush: css">.a {
  background-color: rgb(0,255,0);
}
#b {
  width: 200px;
  height: 210px;
}
.c {
  width: 100px;
  height: 100px;
  border: 1px solid black;
  padding: 2px;
  mix-blend-mode: difference;
}
#d {
  isolation: auto;
}
#e {
  isolation: isolate;
}</pre>

<p>{{ EmbedLiveSample('Examples', "230", "230") }}</p>

<h2 id="Especificaciones">Especificaciones</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{ SpecName('Compositing', '#isolation', 'Isolation') }}</td>
   <td>{{ Spec2('Compositing') }}</td>
   <td>Initial definition</td>
  </tr>
 </tbody>
</table>

<h2 id="Compatibilidad_de_navegadores">Compatibilidad de navegadores</h2>

{{Compat("css.properties.isolation")}}

<h2 id="También_puedes_ver">También puedes ver</h2>

<ul>
 <li>{{cssxref("&lt;blend-mode&gt;")}}</li>
 <li>{{cssxref("mix-blend-mode")}}, {{cssxref("background-blend-mode")}}</li>
</ul>