HTML <a> 태그

반응형

정의 및 사용법

태그 <a>는 한 페이지에서 다른 페이지로 연결하는 데 사용되는 하이퍼링크를 정의합니다.

요소 의 가장 중요한 속성 은 링크의 대상을 나타내는 속성 <a>입니다 . href

기본적으로 링크는 모든 브라우저에서 다음과 같이 표시됩니다.

  • 방문하지 않은 링크는 밑줄이 그어져 파란색으로 표시됩니다.
  • 방문한 링크는 밑줄이 그어져 보라색으로 표시됩니다.
  • 활성 링크는 밑줄이 그어져 빨간색으로 표시됩니다.

팁과 참고 사항

팁: 태그 <a>에 속성이 없으면 href하이퍼링크에 대한 자리 표시자일 뿐입니다.

팁: 다른 대상을 지정하지 않는 한 링크된 페이지는 일반적으로 현재 브라우저 창에 표시됩니다.

속성

Attribute Value Description
download filename Specifies that the target will be downloaded when a user clicks on the hyperlink
href URL Specifies the URL of the page the link goes to
hreflang language_code Specifies the language of the linked document
media media_query Specifies what media/device the linked document is optimized for
ping list_of_URLs Specifies a space-separated list of URLs to which, when the link is followed, post requests with the body ping will be sent by the browser (in the background). Typically used for tracking.
referrerpolicy no-referrer Specifies which referrer information to send with the link
no-referrer-when-downgrade
origin
origin-when-cross-origin
same-origin
strict-origin-when-cross-origin
unsafe-url
rel alternate Specifies the relationship between the current document and the linked document
author
bookmark
external
help
license
next
nofollow
noreferrer
noopener
prev
search
tag
target _blank Specifies where to open the linked document
_parent
_self
_top
type media_type Specifies the media type of the linked document
반응형