HTML5 タグ 108種類 — 使い方 / 使用例 / 実行例
← Tools
使い方:HTML文書全体を囲むルート要素。
使用例:
<html lang="ja">
...
</html>
実行例:
(このページ全体が <html> で囲まれています)
説明:CSS, JS, meta 情報などを入れる領域。
<head>
<meta charset="UTF-8">
<title>ページ名</title>
</head>
(このページの <head> にタイトルなどが入っています)
<title>サイト名</title>
ブラウザのタブに表示されるテキストです。
<meta charset="UTF-8">
文字コードやSEOなどの設定に使います。
<body>
ページに表示される内容
</body>
(このページのすべての表示内容が <body> 内にあります)
<section>これはセクションです</section>
<article>独立した記事</article>
<h1>タイトル1</h1>
<h2>タイトル2</h2>
<h3>タイトル3</h3>
<h4>タイトル4</h4>
<h5>タイトル5</h5>
<h6>タイトル6</h6>
タイトル1
タイトル2
タイトル3
タイトル4
タイトル5
タイトル6
<span>インライン要素</span>
インライン要素
<strong>重要な文字</strong>
重要な文字
<small>小さい文字</small>
小さい文字
<blockquote>引用文</blockquote>
<code>print("hi")</code>
print("hi")
<pre>
改行が
そのまま
表示されます
</pre>
<img src="https://raiprogram3588.com/favicon.ico">
<figure>図や表をまとめる</figure>
図や表をまとめる
<figure>
<img src="https://raiprogram3588.com/favicon.ico">
<figcaption>説明</figcaption>
</figure>
説明
<audio controls>
<source src="sample.mp3">
</audio>
(音声プレイヤー)
<video width="200" controls>
<source src="sample.mp4">
</video>
(動画プレイヤー)
<audio>
<source src="a.mp3">
</audio>
(メディア要素内で使用)
<video>
<track kind="captions" src="sample.vtt">
</video>
(字幕ファイルが必要)
<a href="https://example.com">リンク</a>
<button>クリック</button>
<form>
<input type="text">
</form>
<textarea>ここに入力</textarea>
<select>
<option>りんご</option>
<option>みかん</option>
</select>
<select>
<option>A</option>
<option>B</option>
</select>
<fieldset>
<legend>タイトル</legend>
</fieldset>
<progress value="50" max="100"></progress>
<meter value="0.6"></meter>
<iframe src="https://example.com" width="200" height="100"></iframe>
<canvas id="myCanvas" width="100" height="50"></canvas>
<script>alert("Hello");</script>
<noscript>JavaScript無効です</noscript>
<link rel="stylesheet" href="style.css">
(CSSを外部参照します)
<style>
p { color: red; }
</style>
<abbr title="Hyper Text Markup Language">HTML</abbr>
<time datetime="2025-11-30">2025年11月30日</time>
<details>
<summary>タイトル</summary>
内容
</details>
タイトル
内容
<details>
<summary>開く</summary>
詳細
</details>
開く
詳細
<dialog open>ダイアログ</dialog>
<menu>
<li>項目1</li>
</menu>
<menu>
<menuitem label="項目"></menuitem>
</menu>
<ol>
<li>項目1</li>
<li>項目2</li>
</ol>
<ul>
<li>項目A</li>
<li>項目B</li>
</ul>
<table border="1">
<tr><td>A</td></tr>
</table>
<table border="1">
<tr><td>行1</td></tr>
</table>
<table border="1">
<tr><td>セル1</td></tr>
</table>
<table border="1">
<tr><th>見出し</th></tr>
</table>
<table border="1">
<thead><tr><th>H</th></tr></thead>
</table>
<table border="1">
<tbody><tr><td>データ</td></tr></tbody>
</table>
<table border="1">
<tfoot><tr><td>合計</td></tr></tfoot>
</table>
<table border="1">
<colgroup><col span="2"></colgroup>
</table>
<table border="1">
<col span="1">
</table>
<table border="1">
<caption>表タイトル</caption>
</table>
<embed src="sample.pdf" width="100" height="50">
<object data="sample.pdf" width="100" height="50"></object>
<object data="movie.mp4">
<param name="autoplay" value="true">
</object>
<img src="img.png" usemap="#map">
<map name="map">
<area shape="rect" coords="0,0,50,50" href="#">
</map>
<map name="map">
<area shape="circle" coords="25,25,20" href="#">
</map>
<bdo dir="rtl">右から左</bdo>
右から左
<template>
<p>テンプレート</p>
</template>
(表示されませんが JSで利用可能)
<slot name="content"></slot>
(Web Components内に内容を差し込む)
<picture>
<source media="(max-width:600px)" srcset="small.png">
<img src="large.png">
</picture>
<svg width="100" height="50">
<rect width="100" height="50" fill="blue"></rect>
</svg>
<svg width="100" height="50">
<path d="M10 10 H 90 V 40 H 10 Z" stroke="red" fill="transparent"></path>
</svg>
<svg width="50" height="50">
<circle cx="25" cy="25" r="20" fill="green"></circle>
</svg>
<svg width="100" height="50">
<ellipse cx="50" cy="25" rx="40" ry="20" fill="orange"></ellipse>
</svg>
<svg width="100" height="50">
<line x1="0" y1="0" x2="100" y2="50" stroke="black"></line>
</svg>
<svg width="100" height="50">
<polyline points="0,0 50,25 100,0" stroke="blue" fill="none"></polyline>
</svg>
<svg width="100" height="50">
<polygon points="50,0 100,50 0,50" fill="purple"></polygon>
</svg>
<svg width="200" height="50">
<text x="10" y="30" font-size="20">SVG文字</text>
</svg>
← Tools