Jump to content

Change Font Weight by value on Roll Over in Menu

Go to solution Solved by Ziggy,

Recommended Posts

Hello

 Iam trying to change the weight of a font (with available weights) by value on roll over on a menu with drop downs  in SS 7.1

 I have achieved rollover change with following code when code value is bold, but not when  the value is a weight ie 400  etc

.header-nav a:hover{font-weight:200;/*Default font weight*/
}
.header-nav a:hover{font-weight:400;/*Font weight on hover*/
}

Also with transition to bold there is a position shift  which Iam unsure is enevitable but with a smaller  weight increase would be less noticable 

Any help or advice much appreciated 

Thank you  

Link to comment
  • Solution

You have the hover state set twice:

image.png.7412f11b2b96a283b3db17bb0bf4ab14.png

Try this code instead:

// Default font weight
.header-nav a {
  font-weight:200;
}
// Font weight on hover
.header-nav a:hover {
  font-weight:400;
}

 

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 
 🖼️ Pinch-to-Zoom Gallery Lightbox Plugin (Referral link) 

 Did I help? Buy me a coffee?

Link to comment
  • 2 weeks later...

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.