HTML <body> 요소는 HTML 문서의 내용을 나타냅니다. 한 문서에 하나의 <body> 요소만 존재할 수 있습니다.

  • 콘텐츠 범주 Sectioning root.
  • 허용된 콘텐츠 Flow 컨텐트.
  • 태그 생략 태그 내의 첫번째 것이 공백, 주석, <script>요소, <style>요소가 아닐경우 시작태그를 생략할수 있습니다. body 요소가 시작태그를 가지고있고, 바로 뒤에 주석이 따라오지 않는다면 종료 태그를 생략할수 있습니다.
  • 허용된 부모 요소 <html> 요소의 두번째 요소여야 합니다.
  • DOM 인터페이스 HTMLBodyElement

속성

이 요소는 전역 속성을 포함합니다.

alink
선택한 하이퍼텍스트 링크의 색. 이 방법은 적합하지 않습니다. CSS color 속성과 :active의 조합을 대신 사용하세요.
background
배경 이미지의 URI. 이 방법은 적합하지 않습니다. CSS background 속성을 대신 적용하세요.
bgcolor
배경색. 이 방법은 적합하지 않습니다. CSS background-color 속성을 대신 적용하세요.
bottommargin
아래쪽 여백. 이 방법은 적합하지 않습니다. CSS margin-bottom 속성을 대신 적용하세요.
leftmargin
왼쪽 여백. 이 방법은 적합하지 않습니다. CSS margin-left 속성을 대신 적용하세요.
link
방문하지 않은 하이퍼텍스트 링크의 색. 이 방법은 적합하지 않습니다. CSS color 속성과 :link의 조합을 대신 사용하세요.
onafterprint
사용자가 문서를 출력한 뒤 호출할 함수.
onbeforeprint
사용자가 문서 출력을 요청했을 때 호출할 함수.
onbeforeunload
문서를 처분unload하기 직전에 호출할 함수.
onblur
문서가 포커스를 상실했을 때 호출할 함수.
onerror
문서를 제대로 불러오지 못했을 때 호출할 함수.
onfocus
문서가 포커스를 받을 때 호출할 함수.
onhashchange
문서의 현재 주소 중 Fragment identifier part(해시('#') 문자로 시작)가 변경됐을 때 호출할 함수.
onlanguagechange
선호 언어 변경 시 호출할 함수.
onload
문서를 다 불러왔을 때 호출할 함수.
onmessage
문서가 메시지를 받았을 때 호출할 함수.
onoffline
네트워크 연결이 실패했을 때 호출할 함수.
ononline
네트워크 연결을 복구했을 때 호출할 함수.
onpopstate
사용자가 세션 기록을 따라 이동했을 때 호출할 함수.
onredo
사용자가 되돌리기 변경 기록undo transaction history에서 다시 이후로 이동했을 때 호출할 함수.
onresize
문서의 크기가 바뀔 때 호출할 함수.
onstorage
저장 영역이 변경되었을 때 호출할 함수.
onundo
사용자가 되돌리기 변경 기록undo transaction history에서 이전으로 이동했을 때 호출할 함수.
onunload
문서가 처분unload 중일 때 호출할 함수.
rightmargin
오른쪽 여백. 이 방법은 적합하지 않습니다. CSS margin-right 속성을 대신 적용하세요.
text
글자의 전경색. 이 방법은 적합하지 않습니다. CSS color 속성을 대신 적용하세요.
topmargin
위쪽 여백. 이 방법은 적합하지 않습니다. CSS margin-top 속성을 대신 적용하세요.
vlink
방문했던 하이퍼텍스트 링크의 색. 이 방법은 적합하지 않습니다. CSS color 속성과 :visited의 조합을 대신 사용하세요.

예제

<html>
  <head>
    <title>문서 제목</title>
  </head>
  <body>
    <p>문단입니다</p>
  </body>
</html>

명세

Specification Status Comment
HTML Living Standard
The definition of '<body>' in that specification.
Living Standard Changed the list of non-conforming features.
HTML5
The definition of '<body>' in that specification.
Recommendation 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.
Recommendation Deprecated the alink, background, bgcolor, link, text and vlink attributes.

브라우저 호환성

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
bodyChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
alink
Deprecated
Chrome Full support 1Edge Full support 12Firefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
background
Deprecated
Chrome Full support 1Edge Full support 12Firefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
bgcolor
Deprecated
Chrome Full support 1Edge Full support 12Firefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
bottommargin
Deprecated
Chrome Full support YesEdge No support NoFirefox Full support 35
Notes
Full support 35
Notes
Notes Before Firefox 35, it was supported in Quirks Mode only.
IE No support NoOpera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 35
Notes
Full support 35
Notes
Notes Before Firefox 35, it was supported in Quirks Mode only.
Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes
leftmargin
Deprecated
Chrome Full support YesEdge No support NoFirefox Full support 35
Notes
Full support 35
Notes
Notes Before Firefox 35, it was supported in Quirks Mode only.
IE No support NoOpera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 35
Notes
Full support 35
Notes
Notes Before Firefox 35, it was supported in Quirks Mode only.
Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes
link
Deprecated
Chrome Full support 1Edge Full support 12Firefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
onafterprintChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
onbeforeprintChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
onbeforeunloadChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
onblurChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
onerrorChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
onfocusChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
onhashchangeChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
onlanguagechange
Experimental
Chrome ? Edge No support NoFirefox Full support 32IE No support NoOpera ? Safari ? WebView Android ? Chrome Android ? Firefox Android Full support 32Opera Android ? Safari iOS ? Samsung Internet Android ?
onloadChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
onmessageChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
onofflineChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
ononlineChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
onpopstateChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
onredoChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
onresizeChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
onstorageChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
onundoChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
onunloadChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
rightmargin
Deprecated
Chrome Full support YesEdge No support NoFirefox Full support 35
Notes
Full support 35
Notes
Notes Before Firefox 35, it was supported in Quirks Mode only.
IE No support NoOpera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 35
Notes
Full support 35
Notes
Notes Before Firefox 35, it was supported in Quirks Mode only.
Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes
text
Deprecated
Chrome Full support 1Edge Full support 12Firefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
topmargin
Deprecated
Chrome Full support YesEdge No support NoFirefox Full support 35
Notes
Full support 35
Notes
Notes Before Firefox 35, it was supported in Quirks Mode only.
IE No support NoOpera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 35
Notes
Full support 35
Notes
Notes Before Firefox 35, it was supported in Quirks Mode only.
Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes
vlink
Deprecated
Chrome Full support 1Edge Full support 12Firefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
Deprecated. Not for use in new websites.
Deprecated. Not for use in new websites.
See implementation notes.
See implementation notes.

참고

문서 태그 및 공헌자

이 페이지의 공헌자: mdnwebdocs-bot, alattalatta, azunyan3
최종 변경자: mdnwebdocs-bot,