<mark>

HTML <mark> 요소는 특정 문맥과 관련있어서 참조 목적으로 표시된 하이라이트된 글자를 나타냅니다. 예를 들면, 검색 결과에서 검색에 대한 단어의 모든 인스턴스를 표시하기 위해 사용될수 있습니다.

속성

이 요소는 전역 속성만을 포함합니다.

사용 참고

Typical use cases for <mark> include:

  • When used in a quotation (<q>) or block quote (<blockquote>), it generally indicates text which is of special interest but is not marked in the original source material, or material which needs special scrutiny even though the original author didn't think it was of particular importance. Think of this like using a highlighter pen in a book to mark passages that you find of interest.
  • Otherwise, <mark> indicates a portion of the document's content which is likely to be relevant to the user's current activity. This might be used, for example, to indicate the words that matched a search operation.
  • Don't use <mark> for syntax highlighting purposes; instead, use the <span> element with appropriate CSS applied to it.

Don't confuse <mark> with the <strong> element; <mark> is used to denote content which has a degree of relevance, while <strong> indicates spans of text of importance.

예제

Marking text of interest

In this first example, a <mark> element is used to mark some text within a quote which is of particular interest to the user.

<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>

The resulting output looks like this:

Identifying context-sensitive passages

This example demonstrates using <mark> to mark search results within a passage.

<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>

To help distinguish the use of <mark> for search results from other potential usage, this example applies the custom class "match" to each match.

The results look like this:

명세

명세 상태 주석
HTML Living Standard
The definition of '<mark>' in that specification.
Living Standard  
HTML5
The definition of '<mark>' in that specification.
Recommendation  

브라우저 호환성

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
markChrome Full support YesEdge Full support YesFirefox Full support 4IE Full support 9Opera Full support 11Safari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes

Legend

Full support  
Full support

같이 보기