번역 작업 진행중입니다.

HTML <a> 요소 (앵커 요소)는 다른 페이지, 파일, 같은 페이지의 어느 위치, 이메일 주소나 그 외 다른 URL로 연결할 수 있는 하이퍼링크를 만듭니다.

콘텐츠 범주 플로우 콘텐츠, 구문 콘텐츠, 대화형 컨텐츠, 가시성 컨텐츠.
허용된 콘텐츠 플로우 콘텐츠(대화형 콘텐츠 제외)나 구문 콘텐츠를 포함한 투명 콘텐츠
태그 생략 None, both the starting and ending tag are mandatory.
허용된 부모 요소

구문 콘텐츠를 허용하는 모든 요소, 또는 플로우 콘텐츠를 허용하는 모든 요소. 단, <a> 요소는 언제나 제외.

허용된 ARIA 역할 button, checkbox, menuitem, menuitemcheckbox, menuitemradio, option, radio, switch, tab, treeitem
DOM 인터페이스 HTMLAnchorElement

속성

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

download HTML5
이 속성이 존재할경우, 작성자가 하이퍼링크가 리소스를 다운로드 하는데에 쓰이도록 의도(유저가 링크를 클릭하면 즉각적으로 로컬 저장소에 다운로드 되도록) 한다는것을 나타냅니다. 만약 이 속성이 값을 가질경우, 유저가 링크를 클릭하고 나오는 저장창에 미리 채워진 파일 이름의 값으로 사용됩니다. (특정 경로를 암시하는것을 막기위해 /와 \는 밑줄로 변환되긴 하지만) 값에 어떠한 제한도 없습니다. 하지만 파일 시스템 대부분이 마침표가 파일 이름에 지원되는 것, 브라우저가 알맞게 파일 이름을 인식하는 것에 대한 제약이 있다는 것을 아셔야 합니다.
참고:
  • 이 속성은 동일 출처 정책(same-origin URLs)에 의거해서만 작동합니다.
  • 이 속성은 blob: URLsdata: URLs 을 함께 사용하여 JavasSript,이미지 편집기,웹응용 프로그램에서 만든 그림 등을 다운로드 할 수 있습니다.
  • If the HTTP header Content-Disposition: gives a different filename than this attribute, the HTTP header takes priority over this attribute.
  • If Content-Disposition: is set to inline, Firefox prioritizes Content-Disposition, like the filename case, while Chrome prioritizes the download attribute.
href
예전에는 이 속성으로만 하이퍼텍스트 링크를 정의했습니다. 그래서 <a> 요소에게 필수적이었습니다. 그러나 HTML5에서는 더 이상 필수 사항이 아닙니다. 이 속성을 빼면 하나의 빈 링크를 만듭니다. href 속성은 URL이나 'URL 조각'과 같이 연결할 대상을 가리킵니다. 'URL 조각'은 앞에 해시 태그(#)가 달린 이름이고, 현재 문서에 있는 내부의 목표 지점(ID 속성을 가진)을 의미합니다. URL은 HTTP 기반 문서 외에서도 쓰입니다. URL은 브라우저가 지원하는 어떠한 프로토콜에도 사용할 수도 있습니다. 그 예로, 사용자 환경에서는 file, ftp, 그리고 mailto 링크가 많이 사용됩니다.

참고: 위로 가기 링크를 만들기 위한 특수 부분 링크인 "top"을 만드실 수 있습니다. 예를 들어, <a href="#top">Return to top</a>. This behavior is specified by HTML5.

hreflang
이 속성은 링크된 리소스가 어떤 언어로 작성되었는지 명시합니다. HTML5의 BCP47과 HTML4의 RFC1766으로 허용되는 값이 한정됩니다. 이 속성은 href 속성이 존재할 때만 쓰십시오.
ping
Contains a space-separated list of URLs to which, when the hyperlink is followed, POST requests with the body PING will be sent by the browser (in the background). Typically used for tracking.
referrerpolicy
Indicates which referrer to send when fetching the URL:
  • 'no-referrer' means the Referer: header will not be sent.
  • 'no-referrer-when-downgrade' means no Referer: header will be sent when navigating to an origin without HTTPS. This is the default behavior.
  • 'origin' means the referrer will be the origin of the page, not including information after the domain.
  • 'origin-when-cross-origin' meaning that navigations to other origins will be limited to the scheme, the host and the port, while navigations on the same origin will include the referrer's path.
  • 'unsafe-url' means the referrer will include the origin and path, but not the fragment, password, or username. This is unsafe because it can leak data from secure URLs to insecure ones.
rel
Specifies the relationship of the target object to the link object. The value is a space-separated list of link types.
target
링크한 URL을 어디에 표시할건지 지정합니다. 가능한 값은 브라우징 문맥, 즉 탭, 창, 또는 <iframe>의 이름 또는 키워드입니다. 다음 키워드는 특별한 뜻을 가지고 있습니다.
  • _self: URL을 현재 브라우징 문맥에 표시합니다. 기본 행동 유형입니다.
  • _blank: URL을 새로운 브라우징 문맥에 표시합니다. 보통 새 탭이지만, 사용자가 브라우저 설정을 통해 새 창으로 바꿀 수 있습니다.
  • _parent: URL을 현재 브라우징 문맥의 부모에 표시합니다. 부모가 존재하지 않으면 _self와 동일하게 행동합니다.
  • _top: URL을 최상단 브라우징 문맥(현재 문맥의 부모면서 자신의 부모가 존재하지 않는, 제일 높은 문맥)에 표시합니다. 부모가 존재하지 않으면 _self와 동일하게 행동합니다.

참고: When using target, consider adding rel="noreferrer" to avoid exploitation of the window.opener API.

참고: Linking to another page using target="_blank" will run the new page on the same process as your page. If the new page is executing expensive JS, your page's performance may suffer. To avoid this use rel="noopener".

type
This attribute specifies the media type in the form of a MIME type for the link target. Generally, this is provided strictly as advisory information; however, in the future a browser might add a small icon for multimedia types. For example, a browser might add a small speaker icon when type is set to audio/wav. For a complete list of recognized MIME types, see http://www.w3.org/TR/html4/references.html#ref-MIMETYPES. Use this attribute only if the href attribute is present.

예제

외부 위치로 링크 걸기

<!-- 외부 파일로 링크한 앵커 -->
<a href="http://www.mozilla.com/">
외부 링크
</a>

결과

External Link

클릭 가능한 이미지 생성하기

이 간단한 예제는 MDN 홈페이지로 링크하기 위해 이미지를 사용합니다. 홈페이지는 새로운 브라우저 내용물(새 탭/창)에서 열릴 것입니다.

<a href="https://developer.mozilla.org/en-US/" target="_blank">
  <img src="https://mdn.mozillademos.org/files/6851/mdn_logo.png" alt="MDN logo" />
</a>

결과

이메일 링크 생성하기

It's common to create buttons or links that will open in the user's email program to allow them to send a new message. This is done by using a mailto link. Here's a simple example:

<a href="mailto:nowhere@mozilla.org">Send email to nowhere</a>

This results in a link that looks like this: Send email to nowhere.

For additional details about the mailto URL scheme, such as how to include the subject, body, or other predetermined content, see Email links or RFC 6068.

명세

Specification Status Comment
Referrer Policy
The definition of 'referrer attribute' in that specification.
Candidate Recommendation Added the referrerattribute.
HTML Living Standard
The definition of '<a>' in that specification.
Living Standard  
HTML5
The definition of '<a>' in that specification.
Recommendation  
HTML 4.01 Specification
The definition of '<a>' in that specification.
Recommendation  

브라우저 호환성

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome Full support YesEdge Full support YesFirefox Full support Yes
Notes
Full support Yes
Notes
Notes Starting with Firefox 41, <a> without href attribute is no longer classified as interactive content: clicking it inside <label> will activate labelled content (bug 1167816).
IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support Yes
Notes
Full support Yes
Notes
Notes Starting with Firefox 41, <a> without href attribute is no longer classified as interactive content: clicking it inside <label> will activate labelled content (bug 1167816).
Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
charset
Deprecated
Chrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
coords
Deprecated
Chrome No support NoEdge No support NoFirefox No support ? — 58
Notes
No support ? — 58
Notes
Notes You can no longer nest an <a> element inside a <map> element to create a hotspot region — coords and shape attribute support removed.
IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile No support NoFirefox Android No support ? — 58
Notes
No support ? — 58
Notes
Notes You can no longer nest an <a> element inside a <map> element to create a hotspot region — coords and shape attribute support removed.
Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
downloadChrome Full support 14Edge Full support 18
Full support 18
Partial support 13
Notes
Notes Until Edge 14 (build 14357), attempting to download data URIs caused Edge to crash (bug 7160092).
Notes Edge 17 or older didn't follow the attributes' value to determine filename (bug 7260192).
Firefox Full support 20IE No support NoOpera Full support 15Safari Full support 10.1WebView Android ? Chrome Android ? Edge Mobile Full support YesFirefox Android Full support 20Opera Android ? Safari iOS No support NoSamsung Internet Android ?
hrefChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
hreflangChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
name
Deprecated
Chrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
ping
Experimental
Chrome Full support YesEdge No support NoFirefox Full support Yes
Disabled
Full support Yes
Disabled
Disabled This feature is behind the browser.send_pings preference (needs to be set to true). To change preferences in Firefox, visit about:config.
IE No support NoOpera Full support YesSafari No support NoWebView Android ? Chrome Android ? Edge Mobile No support NoFirefox Android Full support Yes
Disabled
Full support Yes
Disabled
Disabled This feature is behind the browser.send_pings preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Opera Android ? Safari iOS No support NoSamsung Internet Android ?
referrerpolicyChrome Full support 51Edge No support NoFirefox Full support 50IE No support NoOpera Full support 38Safari Full support 11.1WebView Android Full support 51Chrome Android Full support 51Edge Mobile No support NoFirefox Android Full support 50Opera Android Full support 38Safari iOS No support NoSamsung Internet Android Full support 7.2
relChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
rev
Deprecated
Chrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
shape
Deprecated
Chrome No support NoEdge No support NoFirefox No support ? — 58
Notes
No support ? — 58
Notes
Notes You can no longer nest an <a> element inside a <map> element to create a hotspot region — coords and shape attribute support removed.
IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile No support NoFirefox Android No support ? — 58
Notes
No support ? — 58
Notes
Notes You can no longer nest an <a> element inside a <map> element to create a hotspot region — coords and shape attribute support removed.
Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
targetChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
typeChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
Deprecated. Not for use in new websites.
Deprecated. Not for use in new websites.
See implementation notes.
See implementation notes.
User must explicitly enable this feature.
User must explicitly enable this feature.

같이 보기

문서 태그 및 공헌자

이 페이지의 공헌자: urty5656, lovefield, pelly_ryu, Kaben, teoli, Basix, azunyan3, Jeongkyu
최종 변경자: urty5656,