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
|
---
title: document.bgColor
slug: DOM/document.bgColor
tags:
- DOM
- DOM 0
- Gecko
- Referência_do_DOM_Gecko
translation_of: Web/API/Document/bgColor
---
<div id="page-top">
<div class="pageText" id="pageText">
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"><span class="lang lang-en">« <a href="/en/Gecko_DOM_Reference" rel="internal" style="text-decoration: none; color: rgb(4, 121, 167);">Referência do DOM Gecko</a></span></p>
<div id="section_1">
<h3 class="editable" id="Sumário" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-weight: normal; font-family: Georgia, 'Times New Roman', Times, serif; color: rgb(43, 39, 32); font-size: 21px; border-bottom-width: 1px; border-bottom-style: solid;">Sumário</h3>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"> </p>
<div style="border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; background-color: rgb(185, 185, 255); font-weight: bold; text-align: center; padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px;">
<p style="margin-top: 4px; margin-right: 0px; margin-bottom: 4px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;">Obsoleto</p>
</div>
<code style="color: inherit; font-weight: inherit;">bgColor</code> obtém / define a cor de fundo do documento atual.
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"> </p>
</div>
<div id="section_2">
<h3 class="editable" id="Sintaxe" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-weight: normal; font-family: Georgia, 'Times New Roman', Times, serif; color: rgb(43, 39, 32); font-size: 21px; border-bottom-width: 1px; border-bottom-style: solid;"><span>Sintaxe</span></h3>
<pre class="eval" style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 0px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; font: normal normal normal 12px/normal 'Courier New', 'Andale Mono', monospace; color: rgb(37, 34, 29);"><em>document.bgColor = </em><em>cor</em>
</pre>
</div>
<div id="section_3">
<h3 class="editable" id="Parâmetros" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-weight: normal; font-family: Georgia, 'Times New Roman', Times, serif; color: rgb(43, 39, 32); font-size: 21px; border-bottom-width: 1px; border-bottom-style: solid;"><span>Parâmetros</span></h3>
<ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 25px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;">
<li style="margin-bottom: 0.25em;"><code style="color: inherit; font-weight: inherit;">color é</code> uma seqüência que representa a cor como uma palavra (em inglês) (por exemplo, "red") ou valor em hexadecimal (por exemplo, "<code style="color: inherit; font-weight: inherit;">#Ff0000</code>").</li>
</ul>
</div>
<div id="section_4">
<h3 class="editable" id="Exemplo" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-weight: normal; font-family: Georgia, 'Times New Roman', Times, serif; color: rgb(43, 39, 32); font-size: 21px; border-bottom-width: 1px; border-bottom-style: solid;"><span>Exemplo</span></h3>
<pre class="eval" style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 0px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; font: normal normal normal 12px/normal 'Courier New', 'Andale Mono', monospace; color: rgb(37, 34, 29);"><code>document.bgColor = "darkblue"; </code>
</pre>
</div>
<div id="section_5">
<h3 class="editable" id="Notas" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-weight: normal; font-family: Georgia, 'Times New Roman', Times, serif; color: rgb(43, 39, 32); font-size: 21px; border-bottom-width: 1px; border-bottom-style: solid;"><span>Notas</span></h3>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;">O valor padrão para essa propriedade no Mozilla Firefox é branco (<code style="color: inherit; font-weight: inherit;">#ffffff </code>em hexadecimal).</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"><code style="color: inherit; font-weight: inherit;">document.bgColor </code>é substituído no <a class="external" href="http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268" rel="external nofollow" title="http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268">DOM Nível 2 HTML </a>. A alternativa recomendada é o uso do estilo CSS <code><a href="/pt/CSS/background-color" title="https://developer.mozilla.org/pt/CSS/background-color">background-color</a></code> que pode ser acessada através do DOM com <code>document.body.style.backgroundColor</code>. Outra alternativa é document.body.bgColor, embora este também seja obsoleto em HTML 4.01 em favor da alternativa de CSS.</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"> </p>
</div>
<div id="section_6">
<h3 class="editable" id="Especificação" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-weight: normal; font-family: Georgia, 'Times New Roman', Times, serif; color: rgb(43, 39, 32); font-size: 21px; border-bottom-width: 1px; border-bottom-style: solid;"><span>Especificação</span></h3>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"><span class="lang lang-en">DOM Nível 0. Não faz parte do padrão .</span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"><span class="lang lang-en"><a class="external" href="http://msdn.microsoft.com/en-us/library/ms533506(VS.85).aspx" rel="external nofollow" title="http://msdn.microsoft.com/en-us/library/ms533506(VS.85).aspx">MSDN: Propriedade bgColor</a></span></p>
</div>
</div>
</div>
<div class="collapsed" id="languages" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; position: absolute; top: 0px; right: 15px;">
<h5 id="Idiomas">Idiomas</h5>
</div>
<p> </p>
|