Jump to content

Changing the color of nav links by page.

Go to solution Solved by tuanphan,

Recommended Posts

Hi all, 

Been trying to do this using the color palettes option but I find whenever I try to change the color theme it wont do anything. Then tried to resort to css on the specific page, but when I use the ID for the nav links on that page it also hasn't been doing anything. 

What I am trying to do is on my Contact page and UX design page is change the color of the nav links to white and keep it black on every other page for desktop. 

URLs are: 

https://www.kellyfaria.com/contact

https://www.kellyfaria.com/ux-ui-design

There is another page with this issue but I may just photoshop the dark part of the image out so it can stay black. These two I'd rather keep the banner images and have nav links white for accessibility purposes. For Ux page, because the banner image is a bit busy, i had to drop the contrast/shadows down so it has a dark overlay, so the title could be in white. The Contact banner is a video. 

 

If someone can help me figure out what to do (i'm suspecting using different IDs per page? so the css targets the nav links specific to the page maybe and not a global component?) that would be much appreciated. Also open to any other suggestions. 

Screen Shot 2023-06-27 at 12.05.09 PM.png

Screen Shot 2023-06-27 at 12.05.18 PM.png

Link to comment
  • Replies 5
  • Views 2k
  • Created
  • Last Reply

Top Posters In This Topic

  • Solution

Add this code to Design > Custom CSS

/* Contact - UI UX Design */
body#collection-609b07dde06290237a7ecc4a, body#collection-609c253783d1f50d196b9ed3 {
header#header nav div.header-nav-item a {
    color: white !important;
}
div.burger-inner>div {
    background-color: white !important;
}
}

squarespace-add-css2-min.png

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 7 months later...
On 2/16/2024 at 3:27 AM, christey said:

Hi can someone help me with the same problem? I want my homepage nav links to be white and all other nav links from other pages be black. SOS

Change above code to this to change links on Homepage only

body.homepage {
header#header nav div.header-nav-item>a {
    color: white !important;
}
div.burger-inner>div {
    background-color: white !important;
}
}

In case you setup white on homepage and want code run on other pages, use this code

body:not(.homepage) {
header#header nav div.header-nav-item>a {
    color: black !important;
}
div.burger-inner>div {
    background-color: black !important;
}
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

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.