Jump to content

Custom CSS for all Hyperlinks Format upon Hover

Recommended Posts

My question pertains to customizing hyperlinks on pages upon hover. Specifically, my linked text is desiged to transition from blue to red in a gradient format when hovered. It works for some pages, however on other pages the text is completely white and not visible (although you can still click the link). It also tends to not work with different design color backgrounds. 

Here is my code. My main question is: how do I get this design format to apply to all link text EXCEPT the text in the header (have a separate design for that). Is there something i am missing with the CSS code id's?

// HYPERLINKS ANIMATION & DESIGN

 .sqs-block-html p a, .sqs-block-markdown p a, .collection-type-products.view-item p a {
  
  position: relative;
  display: inline;
  font-size: 1em;
  font-weight: 400;
  color: navy;
  overflow: hidden;}

 .sqs-block-html p a, .sqs-block-markdown p a, .collection-type-products.view-item p a  {
  /* Same as before */
  background: linear-gradient(to right, red, red 50%, navy 50%);
}
.sqs-block-html p a, .sqs-block-markdown p a, .collection-type-products.view-item p a   {
  /* Same as before */
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 100%;
  background-position: 100%;
}
.sqs-block-html p a, .sqs-block-markdown p a, .collection-type-products.view-item p a  {
  /* Same as before */
  transition: background-position 400ms ease;
}

.sqs-block-html p a:hover, .sqs-block-markdown p a:hover, .collection-type-products.view-item p a:hover {
  background-position: 0 100%;
}

 

Thank you for any help :)

Link to comment
  • Replies 1
  • Views 669
  • Created
  • Last Reply
On 6/15/2020 at 9:56 PM, joe_AT said:

My question pertains to customizing hyperlinks on pages upon hover. Specifically, my linked text is desiged to transition from blue to red in a gradient format when hovered. It works for some pages, however on other pages the text is completely white and not visible (although you can still click the link). It also tends to not work with different design color backgrounds. 

Here is my code. My main question is: how do I get this design format to apply to all link text EXCEPT the text in the header (have a separate design for that). Is there something i am missing with the CSS code id's?

// HYPERLINKS ANIMATION & DESIGN

 .sqs-block-html p a, .sqs-block-markdown p a, .collection-type-products.view-item p a {
  
  position: relative;
  display: inline;
  font-size: 1em;
  font-weight: 400;
  color: navy;
  overflow: hidden;}

 .sqs-block-html p a, .sqs-block-markdown p a, .collection-type-products.view-item p a  {
  /* Same as before */
  background: linear-gradient(to right, red, red 50%, navy 50%);
}
.sqs-block-html p a, .sqs-block-markdown p a, .collection-type-products.view-item p a   {
  /* Same as before */
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 100%;
  background-position: 100%;
}
.sqs-block-html p a, .sqs-block-markdown p a, .collection-type-products.view-item p a  {
  /* Same as before */
  transition: background-position 400ms ease;
}

.sqs-block-html p a:hover, .sqs-block-markdown p a:hover, .collection-type-products.view-item p a:hover {
  background-position: 0 100%;
}

 

Thank you for any help 🙂

Please post your site url so we can see the issue in action

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

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.