When hovering, focus, visited, activation, and the pseudo-selector link should display a picture. Visited does not work. I do not know the reason. Like statistical pseudo-selectors go to dynamic (by the rule).

a.menu:link { background: #fff url("4.png") center right no-repeat; } a.menu:visited { background: #fff url("2.png") center right no-repeat; } a.menu:hover { background: #fff url("1.png") center right no-repeat; } a.menu:focus:hover { background: #fff url("3.png") center right no-repeat; } a.menu:active:hover { background: #fff url("5.png") center right no-repeat; } a { text-decoration: none; font-size: 30px; padding-right: 25px; padding-left: 15px; } 
 <!DOCTYPE html> <html> <head> <meta charset="utf-8" http-equiv="Content-Type" content="text/html"> <link href="style2.css" rel="stylesheet" type="text/css"> <title></title> </head> <body> <a href="#" id="lar" class="menu">Головна</a> <a href="#" class="menu">Автор</a> <a href="#" class="menu">Новини</a> <a href="#" class="menu">Ресурси</a> </body> </html> 

  • Only pictures, of course, are not available. You can put them on imgur (via the button for attaching a picture in the editor), and then insert the necessary URLs into the code. - Nick Volynkin
  • If you can not cope, answer in the comments, I will help. - Nick Volynkin
  • imgur.com/a/QnMsS imgur.com/a/vNJJC imgur.com/a/i94iV imgur.com/a/Jimbi imgur.com/a/qrVbB How to lay them out so that everyone can see? - Andrew_Romanuk 2:26
  • In the question editor in the panel above the input field there is an icon with a mountain and a sun, it also has a tooltip Изображение <img> Ctrl+G - ߊߚߤߘ
  • And one more thing: if you are accessing a user, refer to him through a dog without spaces (@NickVolynkin) so that he will be notified. - ߊߚߤߘ

1 answer 1

The developers of most browsers avoid using background-images in links with the pseudo-class: “visited”, because they consider them a violation of the privacy of users.

  • one
    It will not work ... - Qwertiy
  • @Qwertiy, you are right. Corrected the answer. - neochar