HTML <body> elementti edustaa HTML-asiakirjan sisältöä. Dokumentissa voi olla vain yksi <body> elementti.

Sisältökategoriat Sectioning root.
Sallittu sisältö Virtaussisältö.
Tagin pois jättäminen Aloitustagi voidaan jättää pois jos ensimmäinen asia elementin sisällä ei ole välilyönti, kommentti, <script> elementti tai <style> elementti. Lopetustagi voidaan jättää pois jos body elementillä on sisältöä tai on aloitustagi ja kommentti ei ole välittömästi sen jälkeen.
Sallitut vanhemmat Sen on oltava jälkimmäinen elementti <html> elementistä.
Sallitut ARIA roolit Ei mitään.
DOM rajapinta HTMLBodyElement

Ominaisuudet

Tämä elementti sisältää globaalit ominaisuudet.

alink
Tekstin väri hyperlinkeille kun valittuna. Tämä menetelmä on epäyhdenmukainen, käytä CSS color ominaisuutta yhdessä :active pseudoluokan kanssa sen sijaan.
background
Taustakuvan URI. Tämä menetelmä on epäyhdenmukainen, käytä CSS background ominaisuutta elementissä sen sijaan.
bgcolor
Taustaväri dokumentille. Tämä menetelmä on epäyhdenmukainen, käytä CSS background-color ominaisuutta elementissä sen sijaan.
bottommargin
Kehon pohjamarginaali. Tämä menetelmä on epäyhdenmukainen, käytä CSS margin-bottom ominaisuutta elementissä sen sijaan.
leftmargin
Kehon vasen marginaali. Tämä menetelmä on epäyhdenmukainen, käytä CSS margin-left ominaisuutta elementissä sen sijaan.
link
Tekstin väri avaamattomille hyperlinkeille. Tämä menetelmä on epäyhdenmukainen, käytä CSS color ominaisuutta yhdessä :link pseudoluokan kanssa sen sijaan.
onafterprint
Funktio, jota kutsua kun käyttäjä on tulostanut dokumentin.
onbeforeprint
Funktio, jota kutsua kun käyttäjä pyytää tulostusta dokumentista.
onbeforeunload
Funktio, jota kutsua kun dokumentti aiotaan purkaa.
onblur
Funktio, jota kutsua kun dokumentti menettää kohdistuksen.
onerror
Funktio, jota kutsua kun dokumentti ei lataudu kunnolla.
onfocus
Funktio, jota kutsua kun dokumentti vastaanottaa kohdistuksen.
onhashchange
Funktio, jota kutsua kun dokumentin fragmenttitunnisteosa (alkaen ('#') risuaitamerkillä) dokumentin nykyisestä osoitteessa on muuttunut.
onlanguagechange
Funktio, jota kutsua kun haluttu kieli muuttuu.
onload
Funktio, jota kutsua kun dokumentti on lopettanut lataamisen.
onmessage
Funktio, jota kutsua kun dokumentti on vastaaottanut viestin.
onoffline
Funktio, jota kutsua kun verkkoyhteys on epäonnistunut.
ononline
Funktio, jota kutsua kun verkkoyhteys on palautunut.
onpopstate
Funktio, jota kutsua kun läyttäjä on navigoinut istuntohistoriaa.
onredo
Funktio, jota kutsua kun käyttäjä on liikkunut eteenpäin kumoa transaktiohistoriassa.
onresize
Funktio, jota kutsua kun dokumentin kokoa on muutettu.
onstorage
Funktio, jota kutsua kun tallennusalue on muuttunut.
onundo
Funktio, jota kutsua kun käyttäjä on liikkunut taaksepäin kumoa transaktiohistoriassa.
onunload
Funktio, jota kutsua kun dokumentti on menossa pois.
rightmargin
Kehon oikea marginaali. Tämä menetelmä on epäyhdenmukainen, käytä CSS margin-right ominaisuutta elementissä sen sijaan.
text
Tekstin etualan väri. Tämä menetelmä on epäyhdenmukainen, käytä CSS color ominaisuutta elementissä sen sijaan.
topmargin
Kehon ylämarginaali. Tämä menetelmä on epäyhdenmukainen, käytä CSS margin-top ominaisuutta elementissä sen sijaan.
vlink
Tekstin väri vierailluille hyperlinkeille. Tämä menetelmä on epäyhdenmukainen, käytä CSS color ominaisuutta yhdessä :visited pseudoluokan kanssa sen sijaan.

Esimerkki

<html>
  <head>
    <title>Dokumentin otsikko</title>
  </head>
  <body>
    <p>Tämä on kappale</p>
  </body>
</html>

Tekniset tiedot

Määritelmä Tila Kommentti
HTML Living Standard
The definition of '<body>' in that specification.
Living Standard Muutetu listaa epäyhdenmukaisista ominaisuuksista.
HTML5
The definition of '<body>' in that specification.
Recommendation Poistettu käytöstä aikaisemmin vanhentuneet ominaisuudet. Määritelty epäyhdenmukaisten käyttäytymienen ja ei-koskaan standardoitu margintop, marginleft, marginright ja marginbottom. Lisätty on* ominaisuudet.
HTML 4.01 Specification
The definition of '<body>' in that specification.
Recommendation Vanhennutettu alink, background, bgcolor, link, text ja vlink ominaisuudet.

Selainyhteensopivuus

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox 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 18Edge Mobile Full support 12Firefox 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 18Edge Mobile Full support 12Firefox 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 18Edge Mobile Full support 12Firefox 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 18Edge Mobile Full support 12Firefox 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 YesEdge Mobile No support NoFirefox 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 YesEdge Mobile No support NoFirefox 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 18Edge Mobile Full support 12Firefox 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 18Edge Mobile Full support 12Firefox 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 18Edge Mobile Full support 12Firefox 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 18Edge Mobile Full support 12Firefox 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 18Edge Mobile Full support 12Firefox 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 18Edge Mobile Full support 12Firefox 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 18Edge Mobile Full support 12Firefox 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 18Edge Mobile Full support 12Firefox 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 ? Edge Mobile No support NoFirefox 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 18Edge Mobile Full support 12Firefox 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 18Edge Mobile Full support 12Firefox 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 18Edge Mobile Full support 12Firefox 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 18Edge Mobile Full support 12Firefox 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 18Edge Mobile Full support 12Firefox 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 18Edge Mobile Full support 12Firefox 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 18Edge Mobile Full support 12Firefox 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 18Edge Mobile Full support 12Firefox 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 18Edge Mobile Full support 12Firefox 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 18Edge Mobile Full support 12Firefox 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 YesEdge Mobile No support NoFirefox 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 18Edge Mobile Full support 12Firefox 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 YesEdge Mobile No support NoFirefox 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 18Edge Mobile Full support 12Firefox 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.

Katso myös

Document Tags and Contributors

Tämän sivun avustajat: mdnwebdocs-bot, mirorauhala
Viimeksi päivittänyt: mdnwebdocs-bot,