From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/web/html/element/mark/index.html | 175 ++++++++++++++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 files/ja/web/html/element/mark/index.html (limited to 'files/ja/web/html/element/mark') diff --git a/files/ja/web/html/element/mark/index.html b/files/ja/web/html/element/mark/index.html new file mode 100644 index 0000000000..8e1737fca6 --- /dev/null +++ b/files/ja/web/html/element/mark/index.html @@ -0,0 +1,175 @@ +--- +title: ': 文字列マーク要素' +slug: Web/HTML/Element/mark +tags: + - HTML + - HTML 文字レベルの意味付け + - HTML5 + - 'HTML:フローコンテンツ' + - 'HTML:知覚可能コンテンツ' + - 'HTML:記述コンテンツ' + - Reference + - ウェブ + - マーク + - 強調 + - 要素 +translation_of: Web/HTML/Element/mark +--- +
{{HTMLRef}}
+ +

HTML の文字列マーク要素 (<mark>) は、周囲の文脈の中でマークを付けた部分の関連性や重要性のために、参照や記述の目的で目立たせたり強調したりする文字列を表します。

+ +
{{EmbedInteractiveExample("pages/tabbed/mark.html", "tabbed-standard")}}
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
コンテンツカテゴリフローコンテンツ, 記述コンテンツ, 知覚可能コンテンツ
許可されている内容記述コンテンツ
タグの省略{{no_tag_omission}}
許可されている親要素記述コンテンツを受け入れるすべての要素
暗黙の ARIA ロール対応するロールなし
許可されている ARIA ロールすべて
DOM インターフェイス{{domxref("HTMLElement")}}
+ +

属性

+ +

この要素にはグローバル属性以外の属性はありません。

+ +

使用上のメモ

+ +

<mark> のよくある利用方法は以下のようなものです。

+ + + +
+

<mark> 要素と {{HTMLElement("strong")}} 要素を混同しないよう注意してください。 <mark>関連性のあるコンテンツを表すために使用されますが、 <strong>重要性のある文字列の区間を表します。

+
+ +

+ +

関心のある文字列のマーク

+ +

最初の例では <mark> 要素を使用して、引用の中でユーザーに特定の関心を引く部分の文字列をマークしています。

+ +
<blockquote>
+  It is a period of civil war. Rebel spaceships, striking from a
+  hidden base, have won their first victory against the evil
+  Galactic Empire. During the battle, <mark>Rebel spies managed
+  to steal secret plans</mark> to the Empire’s ultimate weapon,
+  the DEATH STAR, an armored space station with enough power to
+  destroy an entire planet.
+</blockquote>
+ +

出力結果は以下のようになります。

+ +

{{EmbedLiveSample("Marking_text_of_interest", 650, 130)}}

+ +

文脈に依存する部分の識別

+ +

この例では <mark> を使用して一節の中の検索結果をマークしています。

+ +
<p>It is a dark time for the Rebellion. Although the Death
+Star has been destroyed, <mark class="match">Imperial</mark>
+troops have driven the Rebel forces from their hidden base and
+pursued them across the galaxy.</p>
+
+<p>Evading the dreaded <mark class="match">Imperial</mark>
+Starfleet, a group of freedom fighters led by Luke Skywalker
+has established a new secret base on the remote ice world of
+Hoth.</p>
+ +

検索結果に対する <mark> の使用を他の使い方と区別しやすくするように、この例ではそれぞれの一致部分に "match" カスタムクラスを適用しています。

+ +

結果は以下のようになります。

+ +

{{EmbedLiveSample("Identifying_context-sensitive_passages", 650, 130)}}

+ +

アクセシビリティの考慮

+ +

mark 要素が存在することは、多くの読み上げ技術の既定の設定ではアナウンスされません。 CSS の {{cssxref("::before")}} 及び {{cssxref("::after")}} 擬似要素と共に {{cssxref("content")}} プロパティを使うことでアナウンスさせることができます。

+ +
mark::before,
+mark::after {
+  clip-path: inset(100%);
+  clip: rect(1px, 1px, 1px, 1px);
+  height: 1px;
+  overflow: hidden;
+  position: absolute;
+  white-space: nowrap;
+  width: 1px;
+}
+
+mark::before {
+  content: " [強調開始] ";
+}
+
+mark::after {
+  content: " [強調終了] ";
+}
+
+ +

読み上げソフトを使用する人によっては、特に冗長になるコンテンツのアナウンスを意図的に無効にしていることがあります。このため、この手法を悪用しないようにすることは重要であり、コンテンツが強調されていることを知らないと理解に影響するような場面でのみ使用するようにしてください。

+ + + +

仕様書

+ + + + + + + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('HTML WHATWG', 'text-level-semantics.html#the-mark-element', '<mark>')}}{{Spec2('HTML WHATWG')}}
{{SpecName('HTML5 W3C', 'textlevel-semantics.html#the-mark-element', '<mark>')}}{{Spec2('HTML5 W3C')}}
+ +

ブラウザーの互換性

+ + + +

{{Compat("html.elements.mark")}}

-- cgit v1.2.3-54-g00ecf