aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/html/element/mark
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/ja/web/html/element/mark
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/ja/web/html/element/mark')
-rw-r--r--files/ja/web/html/element/mark/index.html175
1 files changed, 175 insertions, 0 deletions
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: '<mark>: 文字列マーク要素'
+slug: Web/HTML/Element/mark
+tags:
+ - HTML
+ - HTML 文字レベルの意味付け
+ - HTML5
+ - 'HTML:フローコンテンツ'
+ - 'HTML:知覚可能コンテンツ'
+ - 'HTML:記述コンテンツ'
+ - Reference
+ - ウェブ
+ - マーク
+ - 強調
+ - 要素
+translation_of: Web/HTML/Element/mark
+---
+<div>{{HTMLRef}}</div>
+
+<p><span class="seoSummary"><strong>HTML の文字列マーク要素</strong> (<strong><code>&lt;mark&gt;</code></strong>) は、周囲の文脈の中でマークを付けた部分の関連性や重要性のために、参照や記述の目的で目立たせたり強調したりする文字列を表します。</span></p>
+
+<div>{{EmbedInteractiveExample("pages/tabbed/mark.html", "tabbed-standard")}}</div>
+
+<p class="hidden">このデモのソースファイルは GitHub リポジトリに格納されています。デモプロジェクトに協力したい場合は、 <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> をクローンしてプルリクエストを送信してください。</p>
+
+<table class="properties">
+ <tbody>
+ <tr>
+ <th scope="row"><a href="/ja/docs/Web/HTML/Content_categories">コンテンツカテゴリ</a></th>
+ <td><a href="/ja/docs/Web/HTML/Content_categories#Flow_content">フローコンテンツ</a>, <a href="/ja/docs/Web/HTML/Content_categories#Phrasing_content">記述コンテンツ</a>, 知覚可能コンテンツ</td>
+ </tr>
+ <tr>
+ <th scope="row">許可されている内容</th>
+ <td><a href="/ja/docs/Web/HTML/Content_categories#Phrasing_content">記述コンテンツ</a></td>
+ </tr>
+ <tr>
+ <th scope="row">タグの省略</th>
+ <td>{{no_tag_omission}}</td>
+ </tr>
+ <tr>
+ <th scope="row">許可されている親要素</th>
+ <td><a href="/ja/docs/Web/HTML/Content_categories#Phrasing_content">記述コンテンツ</a>を受け入れるすべての要素</td>
+ </tr>
+ <tr>
+ <th scope="row">暗黙の ARIA ロール</th>
+ <td><a href="https://www.w3.org/TR/html-aria/#dfn-no-corresponding-role">対応するロールなし</a></td>
+ </tr>
+ <tr>
+ <th scope="row">許可されている ARIA ロール</th>
+ <td>すべて</td>
+ </tr>
+ <tr>
+ <th scope="row">DOM インターフェイス</th>
+ <td>{{domxref("HTMLElement")}}</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Attributes" name="Attributes">属性</h2>
+
+<p>この要素には<a href="/ja/docs/Web/HTML/Global_attributes">グローバル属性</a>以外の属性はありません。</p>
+
+<h2 id="Usage_notes" name="Usage_notes">使用上のメモ</h2>
+
+<p><code>&lt;mark&gt;</code> のよくある利用方法は以下のようなものです。</p>
+
+<ul>
+ <li>引用 ({{HTMLElement("q")}}) またはブロック引用 ({{HTMLElement("blockquote")}}) の中で使用される場合は、ふつう原文で特にマークされていなくても特別な関心事となる文字列、または原文の筆者が特に重要だと考えていなかったことでも、特別に精査が必要な部分を示します。本の中で興味のある部分が見つかったときに、蛍光ペンを使ってマークするようなものだと考えてください。</li>
+ <li>それ以外に、 <code>&lt;mark&gt;</code> はユーザーの現在の行動に関する文書中の部分を示します。これは例えば、検索操作で検索された語を示す場合などに使用されます。</li>
+ <li><code>&lt;mark&gt;</code> を (ソースコードなどの) 構文の強調には使用しないで下さい。{{HTMLElement("span")}} 要素とそれに適用する適切な CSS を使用してください。</li>
+</ul>
+
+<div class="note">
+<p><code>&lt;mark&gt;</code> 要素と {{HTMLElement("strong")}} 要素を混同しないよう注意してください。 <code>&lt;mark&gt;</code> は<em>関連性</em>のあるコンテンツを表すために使用されますが、 <code>&lt;strong&gt;</code> は<em>重要性</em>のある文字列の区間を表します。</p>
+</div>
+
+<h2 id="Examples" name="Examples">例</h2>
+
+<h3 id="Marking_text_of_interest" name="Marking_text_of_interest">関心のある文字列のマーク</h3>
+
+<p>最初の例では <code>&lt;mark&gt;</code> 要素を使用して、引用の中でユーザーに特定の関心を引く部分の文字列をマークしています。</p>
+
+<pre class="brush: html notranslate">&lt;blockquote&gt;
+ 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, &lt;mark&gt;Rebel spies managed
+ to steal secret plans&lt;/mark&gt; to the Empire’s ultimate weapon,
+ the DEATH STAR, an armored space station with enough power to
+ destroy an entire planet.
+&lt;/blockquote&gt;</pre>
+
+<p>出力結果は以下のようになります。</p>
+
+<p>{{EmbedLiveSample("Marking_text_of_interest", 650, 130)}}</p>
+
+<h3 id="Identifying_context-sensitive_passages" name="Identifying_context-sensitive_passages">文脈に依存する部分の識別</h3>
+
+<p>この例では <code>&lt;mark&gt;</code> を使用して一節の中の検索結果をマークしています。</p>
+
+<pre class="brush: html notranslate">&lt;p&gt;It is a dark time for the Rebellion. Although the Death
+Star has been destroyed, &lt;mark class="match"&gt;Imperial&lt;/mark&gt;
+troops have driven the Rebel forces from their hidden base and
+pursued them across the galaxy.&lt;/p&gt;
+
+&lt;p&gt;Evading the dreaded &lt;mark class="match"&gt;Imperial&lt;/mark&gt;
+Starfleet, a group of freedom fighters led by Luke Skywalker
+has established a new secret base on the remote ice world of
+Hoth.&lt;/p&gt;</pre>
+
+<p>検索結果に対する <code>&lt;mark&gt;</code> の使用を他の使い方と区別しやすくするように、この例ではそれぞれの一致部分に <code>"match"</code> カスタムクラスを適用しています。</p>
+
+<p>結果は以下のようになります。</p>
+
+<p>{{EmbedLiveSample("Identifying_context-sensitive_passages", 650, 130)}}</p>
+
+<h2 id="Accessibility_concerns" name="Accessibility_concerns">アクセシビリティの考慮</h2>
+
+<p><code>mark</code> 要素が存在することは、多くの読み上げ技術の既定の設定ではアナウンスされません。 CSS の {{cssxref("::before")}} 及び {{cssxref("::after")}} 擬似要素と共に {{cssxref("content")}} プロパティを使うことでアナウンスさせることができます。</p>
+
+<pre class="brush: css notranslate">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: " [強調終了] ";
+}
+</pre>
+
+<p>読み上げソフトを使用する人によっては、特に冗長になるコンテンツのアナウンスを意図的に無効にしていることがあります。このため、この手法を悪用しないようにすることは重要であり、コンテンツが強調されていることを知らないと理解に影響するような場面でのみ使用するようにしてください。</p>
+
+<ul>
+ <li><a href="https://developer.paciellogroup.com/blog/2017/12/short-note-on-making-your-mark-more-accessible/">Short note on making your mark (more accessible) | The Paciello Group</a></li>
+ <li><a href="http://adrianroselli.com/2017/12/tweaking-text-level-styles.html">Tweaking Text Level Styles | Adrian Roselli</a></li>
+</ul>
+
+<h2 id="Specifications" name="Specifications">仕様書</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">仕様書</th>
+ <th scope="col">状態</th>
+ <th scope="col">備考</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('HTML WHATWG', 'text-level-semantics.html#the-mark-element', '&lt;mark&gt;')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML5 W3C', 'textlevel-semantics.html#the-mark-element', '&lt;mark&gt;')}}</td>
+ <td>{{Spec2('HTML5 W3C')}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>
+
+<div class="hidden">このページの互換性一覧表は構造化データから生成されています。データに協力していただけるのであれば、 <a class="external" href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックアウトしてプルリクエストを送信してください。</div>
+
+<p>{{Compat("html.elements.mark")}}</p>