Jump to content

Need code to target individual links for hover state (color)

Recommended Posts


I am trying to figure out how to target individual links on a page in order to change the color on "hover". Different links appear on different colored background, so I'd like to be able to target each link individually in order to change the hover color depending on whether or not it's a dark or light background. Thanks if you can help me.

Link to comment

How do I create a way for you to see the site? I haven't done that before. The site that is at the current URL is not the one I'm talking about. I am working on a new site that isn't live. Thanks so much. 

Link to comment
On 5/7/2023 at 6:43 AM, Vicks said:

by the way, you can target individual links by their target ( href attribute ). if you are familiar with CSS, its written like this:

[href='/path/to/your/link'] {
    your custom styles here

Thank you so much. I couldn't get that to work, but this worked for me:

section[data-section-id="6456e8d964adaf26cc121c76"] h4 a:hover {
    color: #194D63 !important;

Link to comment

Create an account or sign in to comment

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

  • 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.