현재 번역은 완벽하지 않습니다. 한국어로 문서 번역에 동참해주세요.
요약
HTML Body 요소 (<body>) 는 HTML 문서의 내용을 나타냅니다. 한 문서에 오직 하나의 <body> 요소만이 존재할수 있습니다.
- 컨텐트 카테고리 Sectioning root.
- 허용된 컨텐트 Flow 컨텐트.
- 태그 생략 태그 내의 첫번째 것이 공백, 주석,
<script>요소,<style>요소가 아닐경우 시작태그를 생략할수 있습니다. body 요소가 시작태그를 가지고있고, 바로 뒤에 주석이 따라오지 않는다면 종료 태그를 생략할수 있습니다. - 허용된 부모 요소들
<html>요소의 두번째 요소여야 합니다. - DOM 인터페이스
HTMLBodyElement- The
<body>element exposes theHTMLBodyElementinterface. - You can access the body element through the
document.bodyattribute.
- The
속성
이 요소는 전역 속성을 포함합니다.
alink- 하이퍼링크가 선택됬을때 글자의 색깔. 이 방법은 적합하지 않습니다. 대신에 CSS
color속성과:active가상-클래스 와의 결합을 사용하십시오. background- 배경으로 사용할 이미지의 URI. 이 방법은 적합하지 않습니다. 대신에 CSS
background속성을 요소에 사용하십시오.Note: Gecko 7.0 (Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4)에서부터,background는 URI로 나타내어질수 없음; 대신에 그것은 간단한 문자열로 취급됨 bgcolor- 문서의 배경 색깔. 이 방법은 적합하지 않습니다. 대신에 CSS
background-color속성을 요소에 사용하십시오. bottommargin- body 끝 부분의 margin. 이 방법은 적합하지 않습니다. 대신에 CSS
margin-bottom속성을 요소에 사용하십시오. leftmargin- body 왼쪽의 margin. 이 방법은 적합하지 않습니다. 대신에 CSS
margin-left속성을 요소에 사용하십시오. link- 방문하지 않은 하이퍼링크의 색깔. 이 방법은 적합하지 않습니다. 대신에 CSS
color속성을:link가상-클래스와 결합을 사용하십시오. onafterprintHTML5- 유저가 문서를 프린트 하는것을 완료한뒤 호출할 함수.
onbeforeprintHTML5- 유저가 문서를 프린트 하는것을 요청했을떄 호출할 함수.
onbeforeunloadHTML5- 문서가 unload 되려고 할때 호출할 함수.
onblurHTML5- 문서가 focus를 상실할떄 호출할 함수.
onerrorHTML5- 문서를 제대로 로드하지 못했을때 호출할 함수.
onfocusHTML5- 문서가 포커스를 받을떄 호출할 함수.
onhashchangeHTML5- 문서의 현재 fragment identifier part (starting with the hash (
'#') character)가 변경되었을떄 호출할 함수. onlanguagechange- preferred languages가 변경되었을떄 호출할 함수
onloadHTML5- 문서가 로딩을 완료했을떄 호출할 함수
onmessageHTML5- 문서가 메세지를 받았을떄 호출할 함수
onofflineHTML5- 네트워크 연결이 실패했을때 호출할 함수
ononlineHTML5- 네트워크 연결이 복구되었을떄 호출할 함수
onpopstateHTML5- Function to call when the user has navigated session history.
onredoHTML5- Function to call when the user has moved forward in undo transaction history.
onresizeHTML5- 문서가 resize 되었을떄 호출할 함수.
onstorageHTML5- storage 영역이 변경되었을떄 호출할 함수.
onundoHTML5- Function to call when the user has moved backward in undo transaction history.
onunloadHTML5- Function to call when the document is going away.
rightmargin- body의 오른쪽 margin. 이 방법은 적합하지 않습니다. 대신에 CSS
margin-right속성을 요소에 사용하십시오. text- 글자의 전경. 이 방법은 적합하지 않습니다, 대신에 CSS
color속성을 요소에 사용하십시오. topmargin- body의 상단 margin. 이 방법은 적합하지 않습니다. 대신에 CSS
margin-top속성을 요소에 사용하십시오. vlink- 방문한 하이퍼링크 텍스트의 색깔. 이 방법은 적합하지 않습니다. 대신에 CSS
color속성과:visited가상-클래스와의 결합을 사용하십시오
명세
| Specification | Status | Comment |
|---|---|---|
| WHATWG HTML Living Standard The definition of '<body>' in that specification. |
Living Standard | 적합하지 않은 특징들의 리스트를 변경 |
| HTML5 The definition of '<body>' in that specification. |
Recommendation | 이전에 Deprecated 되었던 속성들을 Obsoleted 함. Defined the behavior of the non-conforming and never standardized margintop, marginleft, marginright and marginbottom. |
| HTML 4.01 Specification The definition of '<body>' in that specification. |
Recommendation | alink, background, bgcolor, link, text, vlink 속성들을 deprecated 함 |
브라우저 호환성
| 특징 | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
|---|---|---|---|---|---|
| 기본 지원 | 1.0 | (Yes) | (Yes) | (Yes) | (Yes) |
onlanguagechange |
? | 32 (32) | ? | ? | ? |
bottommargin, leftmargin, rightmargin, topmargin |
(Yes) | 35 (35) [1] | ? | ? | ? |
| 특징 | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| 기본 지원 | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) |
onlanguagechange |
? | 32.0 (32) | ? | ? | ? |
bottommargin, leftmargin, rightmargin, topmargin |
(Yes) | 35.0 (35) [1] | ? | ? | ? |
[1] 이 전에 Quirk Mode에서만 지원됐었음.