--- title: 標準メタデータ名 slug: Web/HTML/Element/meta/name tags: - Attribute - HTML - HTML document metadata - Reference - metadata translation_of: Web/HTML/Element/meta/name ---
{{htmlelement("meta")}} 要素を使用して、文書のメタデータを名前と値の組み合わせで提供することができ、 {{htmlattrxref("name", "meta")}} 属性はメタデータ名を指定し、 {{htmlattrxref("content", "meta")}} 属性は値を指定します。
HTML 仕様書は、以下の一連の標準メタデータ名を定義しています。
application-name
: ウェブページで動作しているアプリケーションの名前です。
author
: この文書の著者です。description
: ページの内容を短く正確に要約したものです。 Firefox や Opera など一部のブラウザーは、これをブックマークされたページの既定の説明として使用します。generator
: このページを生成したソフトウェアの識別子です。keywords
: ページのコンテンツに関連する語句で、カンマ区切りです。referrer
: この文書からリクエストを送信するための HTTP の {{httpheader("Referer")}} ヘッダーの内容です。
no-referrer |
HTTP の {{httpheader("Referer")}} ヘッダーを送信しません。 |
origin |
文書の{{glossary("origin", "オリジン")}}を送信します。 |
no-referrer-when-downgrade |
現在のページと同等の安全性の URL (HTTP(S)→HTTPS) にはリファラーとして URL 全体を送信しますが、安全性が低い URL (HTTPS→HTTP) には送信しません。これは既定の動作です。 |
origin-when-cross-origin |
同一オリジンへのリクエストでは URL 全体 (引数を除く) を送信しますが、他の場合はオリジンのみ送信します。 |
same-origin |
同一オリジンにはリファラーを送信しますが、オリジン間リクエストにはリファラーを含めません。 |
strict-origin |
安全性が同等とみられる宛先 (HTTP(S)→HTTPS) に対しては、リファラーとして文書のオリジンのみを送信しますが、安全性が劣る宛先 (HTTPS→HTTP) には送信しません。 |
strict-origin-when-cross-origin |
同一オリジンへのリクエストでは、 URL 全体 (引数を除く) を送信します。現在のページと安全性が同等であると見られる宛先 (HTTP(S)→HTTPS) にはオリジンを送信します。それ以外は、リファラーを送信しません。 |
unsafe-URL |
同一オリジンまたはオリジン間リクエストで、 URL 全体 (引数を除く) を送信します。 |
<meta name="referrer">
(with {{domxref("Document.write", "document.write()")}} or {{domxref("Node.appendChild", "appendChild()")}}) makes the referrer behaviour unpredictable.no-referrer
policy is applied.theme-color
: indicates a suggested color that user agents should use to customize the display of the page or of the surrounding user interface. The content
attribute contains a valid CSS {{cssxref("<color>")}}.The CSS Color Adjustment specification defines the following metadata name:
color-scheme
: specifies one or more color schemes with which the document is compatible.
The browser will use this information in tandem with the user's browser or device settings to determine what colors to use for everything from background and foregrounds to form controls and scrollbars. The primary use for <meta name="color-scheme">
is to indicate compatibility with—and order of preference for—light and dark color modes.
The value of the {{htmlattrxref("content", "meta")}} property for color-scheme
may be one of the following:
normal
light
| dark
]+only light
only dark
is not valid, because forcing a document to render in dark mode when it isn't truly compatible with it can result in unreadable content; all major browsers default to light mode if not otherwise configured.For example, to indicate that a document prefers dark mode but does render functionally in light mode as well:
<meta name="color-scheme" content="dark light">
This works at the document level in the same way that the CSS {{cssxref("color-scheme")}} property lets individual elements specify their preferred and accepted color schemes. Your styles can adapt to the current color scheme using the {{cssxref("@media/prefers-color-scheme", "prefers-color-scheme")}} CSS media feature.
The CSS Device Adaptation specification defines the following metadata name:
viewport
: gives hints about the size of the initial size of the {{glossary("viewport")}}. Used by mobile devices only.
値 | Possible subvalues | 解説 |
---|---|---|
width |
A positive integer number, or the text device-width |
Defines the pixel width of the viewport that you want the web site to be rendered at. |
height |
A positive integer, or the text device-height |
Defines the height of the viewport. Not used by any browser. |
initial-scale |
A positive number between 0.0 and 10.0 |
Defines the ratio between the device width (device-width in portrait mode or device-height in landscape mode) and the viewport size. |
maximum-scale |
A positive number between 0.0 and 10.0 |
Defines the maximum amount to zoom in. It must be greater or equal to the minimum-scale or the behaviour is undefined. Browser settings can ignore this rule and iOS10+ ignores it by default. |
minimum-scale |
A positive number between 0.0 and 10.0 |
Defines the minimum zoom level. It must be smaller or equal to the maximum-scale or the behaviour is undefined. Browser settings can ignore this rule and iOS10+ ignores it by default. |
user-scalable |
yes or no |
If set to no , the user is not able to zoom in the webpage. The default is yes . Browser settings can ignore this rule, and iOS10+ ignores it by default. |
viewport-fit |
auto , contain or cover |
The The The |
user-scalable
to a value of no
prevents people experiencing low vision conditions from being able to read and understand page content.The @viewport
CSS at-rule.
The WHATWG Wiki MetaExtensions page contains a large set of non-standard metadata names that have not been formally accepted yet; however, some of the names included there are already used quite commonly in practice — including the following:
creator
: the name of the creator of the document, such as an organization or institution. If there are more than one, several {{HTMLElement("meta")}} elements should be used.googlebot
, a synonym of robots
, is only followed by Googlebot (the indexing crawler for Google).publisher
: the name of the document's publisher.robots
: the behaviour that cooperative crawlers, or "robots", should use with the page. It is a comma-separated list of the values below:
値 | 解説 | Used by |
---|---|---|
index |
Allows the robot to index the page (default). | All |
noindex |
Requests the robot to not index the page. | All |
follow |
Allows the robot to follow the links on the page (default). | All |
nofollow |
Requests the robot to not follow the links on the page. | All |
all |
Equivalent to index, follow |
|
none |
Equivalent to noindex, nofollow |
|
noarchive |
Requests the search engine not to cache the page content. | Google, Yahoo, Bing |
nosnippet |
Prevents displaying any description of the page in search engine results. | Google, Bing |
noimageindex |
Requests this page not to appear as the referring page of an indexed image. | |
nocache |
Synonym of noarchive . |
Bing |
noindex
will work, but only after the robot visits the page again. Ensure that the robots.txt
file is not preventing revisits.index
and noindex
, or follow
and nofollow
. In these cases the robot's behaviour is undefined and may vary between them.X-Robots-Tag
; this allows non-HTML documents like images to use these rules.仕様書 |
---|
{{SpecName('HTML WHATWG', '#standard-metadata-names', 'standard metadata names')}} |
{{SpecName('CSS Color Adjust', '#color-scheme-meta', 'the "color-scheme" metadata name')}} |
{{SpecName('CSS3 Device', '#viewport-meta', 'the "viewport" metadata name')}} |
{{SpecName('Referrer Policy', '#referrer-policy-delivery-meta', 'the "referrer" metadata name')}} |
{{Compat("html.elements.meta.name")}}