Advertisement
here2share

HTML link background-color

Aug 16th, 2016
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.56 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <style>
  5. a:link {
  6.     background-color: yellow;
  7. }
  8.  
  9. a:visited {
  10.     background-color: cyan;
  11. }
  12.  
  13. a:hover {
  14.     background-color: lightgreen;
  15. }
  16.  
  17. a:active {
  18.     background-color: hotpink;
  19. }
  20. </style>
  21. </head>
  22. <body>
  23.  
  24. <p><b><a href="google.com" target="_blank">This is a link</a></b></p>
  25. <p><b>Note:</b> a:hover MUST come after a:link and a:visited in the CSS definition in order to be effective.</p>
  26. <p><b>Note:</b> a:active MUST come after a:hover in the CSS definition in order to be effective.</p>
  27.  
  28. </body>
  29. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement