MDN self-hosted library · e01.org

`:local-link` CSS pseudo-class

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

css
/* Selects any <a> that links to the current document */
a:local-link {
  color: green;
}
css
:local-link {
  /* ... */
}
html
<a href="#target">This is a link on the current page.</a><br />
<a href="https://example.com">This is an external link</a><br />
css
a:local-link {
  color: green;
}