Widely available すべての主要ブラウザで対応済み。安心して使用可能。

対応ブラウザ

機能 デスクトップ モバイル
Chrome
Edge
Firefox
Safari
Chrome Android
Safari iOS
1
12
1
1
18
1
DOM API

HTMLBodyElement インターフェイスは、(通常の HTMLElement インターフェイスから継承されるもの以外に) body 要素を操作するための特別なプロパティとメソッドを提供します。

1
12
1
3
18
1
1+対応 (バージョン) 未対応 注釈あり サブ機能の解説は MDN Web Docs (CC BY-SA 2.5)

基本構文

HTML
<!DOCTYPE html>
<html lang="ja">
<head><title>Page Title</title></head>
<body>
  <h1>Hello</h1>
  <p>This is the page content.</p>
</body>
</html>

ライブデモ

Body structure example

Use the body element to hold the visible content of the document.

プレビュー全画面表示

One body per page

Summarize the role of the body element in the overall document tree.

プレビュー全画面表示

Document regions

Map common page regions that usually live inside the body element.

プレビュー全画面表示

実務での使いどころ

  • <body> の活用

    <body> は HTML の要素で、HTML 文書のコンテンツを表します。

注意点

  • 古いブラウザでは対応していない場合がある。

アクセシビリティ

  • スクリーンリーダーでの読み上げを確認すること。