[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ko/docs/Web/HTML/Reference/Elements/a [Back]  [Original]

<a> - HTML: Hypertext Markup Language | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

<a>

Baseline Widely available *

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 7.

* Some parts of this feature may have varying levels of support.

HTML <a> ( ) href , , URL . <a> .

In this article

<p>You can reach Michael at:</p>

<ul>
  <li><a href="https://example.com">Website</a></li>
  <li><a href="mailto:m.bluth@example.com">Email</a></li>
  <li><a href="tel:+123456789">Phone</a></li>
</ul>
li {
  margin-bottom: 0.5rem;
}

.

download

URL . , .

:

  • download URL blob:, data: .
  • Content-Disposition filename download . (Content-Disposition: inline , Firefox Chrome download .)
href

URL. HTTP URL , URL .

hreflang

URL . . lang .

ping

URL . , URL POST . .

referrerpolicy

URL . Referrer-Policy .

rel

, URL .

target

URL . , , , <iframe> . .

  • _self: URL . .
  • _blank: URL . , .
  • _parent: URL . _self .
  • _top: URL ( , ) . _self .

: target , rel="noreferrer" window.opener API .

: (Firefox 79+ ) target="_blank" rel="noopener" .

type

URL MIME type . .

, , , .
. ( ) .
, .

, . , <a> .

ARIA href link,
ARIA

href ,

href ,

DOM HTMLAnchorElement

URL

HTML

html
<a href="https://www.mozilla.com">Mozilla</a>

URL

HTML

html
<a href="//example.com">Scheme-relative URL</a>
<a href="/ko/docs/Web/HTML">Origin-relative URL</a>
<a href="./p">Directory-relative URL</a>

html
<!-- <a>     -->
<p><a href="#Section_further_down">  </a></p>

<!--    -->
<h2 id="Section_further_down"> </h2>

: href="#top" (href="#") . HTML .

mailto: .

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

, mailto: URL RFC 6068 .

html
<a href="tel:+49.157.0156">+49 157 0156</a>
<a href="tel:+1(555)5309">(555) 5309</a>

tel: .

tel: URL , , RFC 3966 .

download <canvas> PNG

download data: URL <canvas> .

HTML
html
<p>
     .
  <a href="" download="my_painting.png"></a>
</p>

<canvas width="300" height="300"></canvas>
CSS
css
html {
  font-family: sans-serif;
}
canvas {
  background: #fff;
  border: 1px dashed;
}
a {
  display: inline-block;
  background: #69c;
  color: #fff;
  padding: 5px 10px;
}
JavaScript
js
var canvas = document.querySelector("canvas"),
  c = canvas.getContext("2d");
c.fillStyle = "hotpink";

function draw(x, y) {
  if (isDrawing) {
    c.beginPath();
    c.arc(x, y, 10, 0, Math.PI * 2);
    c.closePath();
    c.fill();
  }
}

canvas.addEventListener("mousemove", (event) =>
  draw(event.offsetX, event.offsetY),
);
canvas.addEventListener("mousedown", () => (isDrawing = true));
canvas.addEventListener("mouseup", () => (isDrawing = false));

document
  .querySelector("a")
  .addEventListener(
    "click",
    (event) => (event.target.href = canvas.toDataURL()),
  );

<a> . Referer : .

target="_blank" rel="noreferrer" rel="noopener" window.opener API . ( ) , (Firefox 79+ ) target="_blank" rel="noopener" .

, .

" " "" .

html
<p>    <a href="/products"></a> .</p>

, !

html
<p> <a href="/products">  </a>.</p>

. . .

onclick

href # javascript:void(0) , click .

href , , JavaScript , . .

<button> . URL .

HTML

target="_blank" / , , .

, , , . .

/

html
<a target="_blank" href="https://ko.wikipedia.org">
   (  )
</a>

HTML

html
<a href="2017-annual-report.ppt">2017   (PowerPoint)</a>

.

html
<a target="_blank" href="https://ko.wikipedia.org">
  
  <img alt="(  )" src="newtab.svg" />
</a>

<a href="2017-annual-report.ppt">
  2017  
  <img alt="(PowerPoint )" src="ppt-icon.svg" />
</a>

(skip link) <body> , . .

html
<body>
  <a href="#content"> </a>

  <header></header>

  <main id="content"><!--   --></main>
</body>
css
.skip-link {
  position: absolute;
  top: -3em;
  background: #fff;
}
.skip-link:focus {
  top: 0;
}

.

, , / .

. , . 44x44 CSS .

, .

. .

margin CSS .

Specification
HTML
# the-a-element


Web Proxy Viewer  |  New URL  |  Original Page