ページ情報[Metadata tag]
<meta>
HTML基本構造の「<head>〜</head>」の中に記述します。 実際の記述では各「Metaタグ」ごとに改行するだけで、その他の部分は改行を入れてはいけません。 また、「</meta>」のような終了タグは必要ありません。
HTMLソース
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="ja">
<head>
<meta http-equiv="content-type" content="text/html; charset=Shift_JIS">
<meta name="keywords" content="キーワード1,キーワード2,キーワード3">
<meta name="description" content="ページの概要(説明文)">
<title>タイトル</title>
</head>
<body>
<h1>実際のページに表示される見出し</h1>
<p>
実際のページに表示される文章
</p>
</body>
</html>
<html lang="ja">
<head>
<meta http-equiv="content-type" content="text/html; charset=Shift_JIS">
<meta name="keywords" content="キーワード1,キーワード2,キーワード3">
<meta name="description" content="ページの概要(説明文)">
<title>タイトル</title>
</head>
<body>
<h1>実際のページに表示される見出し</h1>
<p>
実際のページに表示される文章
</p>
</body>
</html>
属性 | 値 | 機能 |
---|---|---|
name | auther | 作者の名前 |
description | ページ概要 | |
copyright | 著作権 | |
keywords | キーワード | |
date | 日付 | |
generator | アプリケーション | |
http-equiv | content-type | 情報の種類 |
content-style-type | スタイルシート言語 | |
content-script-type | スクリプト言語 | |
refresh | ページの更新 | |
content | 設定値 |
「<meta 属性="値" content="設定値">」のように記述します。 また、content属性は単体では記述できず、name属性・http-equiv属性と併用して記述します。