Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0
ColleenRose

Change color of links ONLY when hovered over

Question

Posted (edited)

I'm looking to make all the links on my page magenta, but ONLY when being hovered over. I have them designed per section so I dont want them to be uniformly one color, but i want them to all have the same color when being hovered over. Every custom css ive found makes all of the links that color even when not being hovered over.

my color is 

#C71585

C71585
Edited by ColleenRose

Share this post


Link to post

1 answer to this question

Recommended Posts

  • 0
Posted (edited)

Generally thats achieved by using the :hover tag in CSS.

Making all links a certain color, except for the ones that got their CSS changed later down the line, would thus be achieved by using the code snippet below.

 

a:hover {
  color: #C71585;
}

 

Personally I think it's always a good Idea to apply the same rules to :focus as to :hover. In this case the links would also change color, when focusing on them using TAB on a computer keyboard.

a:hover, a:focus{
  color: #C71585;
}

 

Edited by 8B39C8

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...