aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/web/css/background-blend-mode/index.html
blob: d69ade2e93e1aeec1bf111b9ac23dd5eca67cdde (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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
---
title: background-blend-mode
slug: Web/CSS/background-blend-mode
tags:
  - CSS
  - Composição de CSS
  - Propriedade CSS
translation_of: Web/CSS/background-blend-mode
---
<div>{{CSSRef}}</div>

<p>A propriedade CSS <strong><code>background-blend-mode</code></strong> descreve como as imagens de fundo do elemento devem se misturar entre si e a cor de fundo do elemento.</p>

<pre class="brush:css no-line-numbers">/* Um valor */
background-blend-mode: normal;

/* Dois valores, um por fundo */
background-blend-mode: darken, luminosity;

/* Valores globais */
background-blend-mode: initial;
background-blend-mode: inherit;
background-blend-mode: unset;
</pre>

<p>Os modos de mistura devem ser definidos na mesma ordem que a propriedade CSS {{cssxref ("background-image")}}. Se os comprimentos da lista dos modos de mistura e das imagens de fundo não forem iguais, ele será repetido e/ou truncado até que os comprimentos correspondam.</p>

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

<h2 id="Sintaxe">Sintaxe</h2>

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

<dl>
 <dt><code>&lt;blend-mode&gt;</code></dt>
 <dd>É um {{cssxref ("&lt;blend-mode&gt;")}} denotando o modo de mesclagem a ser aplicado. Pode haver vários valores, separados por vírgulas.</dd>
</dl>

<h3 id="Sintaxe_formal">Sintaxe formal</h3>

{{csssyntax}}

<h2 id="Exemplos">Exemplos</h2>

<pre class="brush: html hidden">&lt;div id="div"&gt;&lt;/div&gt;
&lt;select id="select"&gt;
    &lt;option&gt;normal&lt;/option&gt;
    &lt;option&gt;multiply&lt;/option&gt;
    &lt;option selected&gt;screen&lt;/option&gt;
    &lt;option&gt;overlay&lt;/option&gt;
    &lt;option&gt;darken&lt;/option&gt;
    &lt;option&gt;lighten&lt;/option&gt;
    &lt;option&gt;color-dodge&lt;/option&gt;
    &lt;option&gt;color-burn&lt;/option&gt;
    &lt;option&gt;hard-light&lt;/option&gt;
    &lt;option&gt;soft-light&lt;/option&gt;
    &lt;option&gt;difference&lt;/option&gt;
    &lt;option&gt;exclusion&lt;/option&gt;
    &lt;option&gt;hue&lt;/option&gt;
    &lt;option&gt;saturation&lt;/option&gt;
    &lt;option&gt;color&lt;/option&gt;
    &lt;option&gt;luminosity&lt;/option&gt;
&lt;/select&gt;</pre>

<pre class="brush: css hidden">#div {
    width: 300px;
    height: 300px;
    background: url('https://mdn.mozillademos.org/files/8543/br.png'),url('https://mdn.mozillademos.org/files/8545/tr.png');
    background-blend-mode: screen;
}</pre>

<pre class="brush: js hidden">document.getElementById("select").onchange = function(event) {
    document.getElementById("div").style.backgroundBlendMode = document.getElementById("select").selectedOptions[0].innerHTML;
}
console.log(document.getElementById('div'));</pre>

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

<h2 id="Especificações">Especificações</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Especificação</th>
   <th scope="col">Status</th>
   <th scope="col">Comentário</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{ SpecName('Compositing', '#background-blend-mode', 'background-blend-mode') }}</td>
   <td>{{ Spec2('Compositing') }}</td>
   <td>Initial definition</td>
  </tr>
 </tbody>
</table>

<h2 id="Compatibilidade_dos_navegadores">Compatibilidade dos navegadores</h2>

<p>{{CompatibilityTable()}}</p>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>35</td>
   <td>{{CompatGeckoDesktop('30.0')}}</td>
   <td>{{CompatNo()}}</td>
   <td>22</td>
   <td>7.1</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatNo()}}</td>
   <td>{{CompatGeckoMobile('30.0')}}</td>
   <td>{{CompatNo()}}</td>
   <td>22</td>
   <td>8</td>
  </tr>
 </tbody>
</table>
</div>

<h2 id="See_also" name="See_also">Veja também</h2>

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