CSS :any-link pseudo-class
- Poprzednia strona :active
- Następna strona :autofill
- Wróć do poprzedniego poziomu Podręcznik odniesień pseudo-klas CSS
Definition and usage
CSS :any-link
The pseudo-class is used to select and set the styles of elements that are the source anchors of hyperlinks.
This pseudo-class works regardless of whether the link has been visited or not.
Therefore, this pseudo-class applies to all elements with the href attribute <a> or <area> Element.
Example
Example 1
Select and set the styles for all <a> elements with the href attribute:
a:any-link { background-color: yellow; color: maroon; }
Example 2
Set styles for all <a> elements with the href attribute. Additionally, set link styles based on the state (hover, active, visited, etc.):
a:any-link { background-color: yellow; color: maroon; } a.ex1:hover, a.ex1:active { color: red; } a.ex2:hover, a.ex2:active { font-size: 150%; }
CSS syntax
:any-link { css declarations; }
Technical details
Version: | CSS Selectors Level 4 |
---|
Browser support
The numbers in the table indicate the first browser version that fully supports this pseudo-class.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
65 | 79 | 50 | 9 | 52 |
Related pages
Tutorial:CSS link
Tutorial:CSS button
Tutorial:CSS pseudo-class
- Poprzednia strona :active
- Następna strona :autofill
- Wróć do poprzedniego poziomu Podręcznik odniesień pseudo-klas CSS