Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. CSS
  3. Reference
  4. Selectors
  5. :local-link

:local-link

Experimental:This is anexperimental technology
Check theBrowser compatibility table carefully before using this in production.

The:local-linkCSSpseudo-class represents a link to the same document. Therefore an element that is the source anchor of a hyperlink whose target's absolute URL matches the element's own document URL.

css
/* Selects any <a> that links to the current document */a:local-link {  color: green;}

Syntax

css
:local-link {  /* ... */}

Examples

HTML

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

css
a:local-link {  color: green;}

Result

Specifications

Specification
Selectors Level 4
# local-link-pseudo

Browser compatibility

Currently, no browsers support this feature.

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp