<body>
O elemento <body>
do HTML representa o conteúdo de um documento HTML. è permitido apenas um <body>
por documento.
Categorias | Seção raiz. |
---|---|
Conteúdo permitido | Conteúdo de fluxo. |
Omissão de tag |
A tag inicial pode ser omitida se a primeira coisa dentro do elemento não for um espaço, comentário, elemento A tag final pode ser omitida se o elemento body possuir conteúdo ou tem uma tag inicial e não é imediatamente seguida por um comentário. |
Elementos pais permitidos | Deve ser o segundo elemento de um elemento <html> . |
DOM interface | HTMLBodyElement (en-US)
|
Atributos
Estes elementos incluem os atributos globais.
alink
- Cor do texto para hyperlinks quando selecionados. Esse método não está em conformidade, utilize a propriedade
color
em conjunto com a pseudo-classe:active
background
- URI de uma imagem para usar como um papel de parede. Esse método não está em conformidade, utilize a propriedade CSS
background
. bgcolor
- Cor de fundo do documento. Esse método não está em conformidade, utilize a propriedade CSS
background-color
. bottommargin
- The margin of the bottom of the body. Esse método não está em conformidade, utilize a propriedade CSS
margin-bottom
. leftmargin
- The margin of the left of the body. Esse método não está em conformidade, utilize a propriedade CSS
margin-left
(en-US). link
- Cor de textos de links não visitados. Esse método não está em conformidade, utilize o
color
em conjunto com a pseudo-classe:link
onafterprint
- Função para chamar depois que o usuário solicitou a impressão do documento.
onbeforeprint
- Função para chamar quando o usuário solicita a impressão do documento.
onbeforeunload
- Função para chamar quando o documento está prestes a ser descarregado.
onblur
- Função para chamar quando o documento perde foco.
onerror
- Função para chamar quando o documento falha ao carregar corretamente.
onfocus
- Função para chamar quando o documento recebe foco.
onhashchange
- Function to call when the fragment identifier part (starting with the hash (
'#'
) character) of the document's current address has changed. onlanguagechange
Experimental- Function to call when the preferred languages changed.
onload
- Função para chamar quando o documento terminar de carregar
onmessage
- Função para chamar quando o documento receber uma mensagem.
onoffline
- Função para chamar quando a conexão com a internet falha.
ononline
- Função para chamar quando a conexão com a internet é restaurada.
onpopstate
- Function to call when the user has navigated session history.
onredo
- Function to call when the user has moved forward in undo transaction history.
onresize
- Function to call when the document has been resized.
onstorage
- Function to call when the storage area has changed.
onundo
- Function to call when the user has moved backward in undo transaction history.
onunload
- Function to call when the document is going away.
rightmargin
- The margin of the right of the body. This method is non-conforming, use CSS
margin-right
(en-US) property on the element instead. text
- Foreground color of text. This method is non-conforming, use CSS
color
property on the element instead. topmargin
- The margin of the top of the body. This method is non-conforming, use CSS
margin-top
property on the element instead. vlink
- Cor do texto para links já visitados. Esse método não está em conformidade, utilize a propriedade CSS
color
em conjunto com a pseudo-classe:visited
.
Especificações
Especificação | Status | Comentário |
---|---|---|
HTML Living Standard The definition of '<body>' in that specification. |
Padrão em tempo real | Changed the list of non-conforming features. |
HTML5 The definition of '<body>' in that specification. |
Recomendação | Obsoleted the formerly deprecated attributes. Defined the behavior of the non-conforming and never standardized margintop , marginleft , marginright and marginbottom . Added the on* attributes. |
HTML 4.01 Specification The definition of '<body>' in that specification. |
Recomendação | Deprecated the alink , background , bgcolor , link , text and vlink attributes. |
Compatibilidade com navegadores
Estamos convertendo nossos dados de compatibilidade para o formato JSON.
Esta tabela de compatibilidade ainda usa o formato antigo,
pois ainda não convertemos os dados que ela contém.
Descubra como você pode ajudar! (en-US)
Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) |
onlanguagechange |
? | 32.0 (32) | ? | ? | ? |
bottommargin , leftmargin , rightmargin , topmargin |
(Yes) | 35.0 (35) [1] | ? | ? | ? |
[1] Was supported before this in Quirk Mode only.