Style for each tag state?

Is there a way to specify a:link, a:visited, a:hover, a:active and possibly also a:focus to use css at a time?

+4
source share
2 answers

If you want to style all the bindings; not only the bindings used as links, but also named anchors (i.e. <a name="foo"></a> ) just use the following css selector:

 a 

What is it.

If you don't need named anchors, but instead only need to style links with the [href] attribute, you should use a comma-separated list of selectors:

 a:link, a:visited, a:hover, a:focus, a:active { color: blue; } 

If you run into specific issues, you need to post some HTML code and look at the CSS specification .

+11
source

Just name them all at once and specify the style:

 a:link, a:active, a:visited, a:hover, a:focus { } 
0
source

Source: https://habr.com/ru/post/1384008/


All Articles