Jump to content

Change color of links ONLY when hovered over

Recommended Posts

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
Link to comment
  • Replies 1
  • Views 246
  • Created
  • Last Reply

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;
}

 

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.