Jump to content

How to add different color underlines in header navigation

Recommended Posts

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Add to Design > Custom CSS

div.header-nav-item a {
    background-image: none !important;
}
div.header-nav-item:nth-child(1)>a {
    border-bottom: 2px solid #000;
}
div.header-nav-item:nth-child(2)>a {
    border-bottom: 2px solid red;
}
div.header-nav-item:nth-child(3)>a {
    border-bottom: 2px solid #f1f;
}
div.header-nav-item:nth-child(4)>a {
    border-bottom: 2px solid brown;
}
div.header-nav-item:nth-child(5)>a {
    border-bottom: 2px solid #f7f8;
}

image.png.33689e9962b6b05c76c4232337e0bb5b.png

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment

Thanks!
Two more quick items on this area. 

1. How do I get the hover color to change? (I added the last line in the below code but that doesn't seem to be resolving. I assume I'm calling the wrong thing in Squarespace)

2. If I want underlines on the mobile version as well. How do I adjust the below to include mobile? 

 

/**
 * Change Color of Navigation underline and hover
**/
div.header-nav-item a {
    background-image: none !important;
}
div.header-nav-item:nth-child(1)>a {
    border-bottom: 2px solid #e72F80;
}
div.header-nav-item:nth-child(2)>a {
    border-bottom: 2px solid #9438b9;
}
div.header-nav-item:nth-child(3)>a {
    border-bottom: 2px solid #00007d;
}
div.header-nav-item:nth-child(4)>a {
    border-bottom: 2px solid #f7f8;
}
div.header-nav-item:nth-child(5)>a {
    border-bottom: 2px solid #f6ce53;
}
div.header-nav li a:hover{
	color:#00007d;
}

 

Link to comment
On 7/3/2023 at 7:22 PM, JA-Build-Change-Impact said:

Thanks!
Two more quick items on this area. 

1. How do I get the hover color to change? (I added the last line in the below code but that doesn't seem to be resolving. I assume I'm calling the wrong thing in Squarespace)

2. If I want underlines on the mobile version as well. How do I adjust the below to include mobile? 

 

/**
 * Change Color of Navigation underline and hover
**/
div.header-nav-item a {
    background-image: none !important;
}
div.header-nav-item:nth-child(1)>a {
    border-bottom: 2px solid #e72F80;
}
div.header-nav-item:nth-child(2)>a {
    border-bottom: 2px solid #9438b9;
}
div.header-nav-item:nth-child(3)>a {
    border-bottom: 2px solid #00007d;
}
div.header-nav-item:nth-child(4)>a {
    border-bottom: 2px solid #f7f8;
}
div.header-nav-item:nth-child(5)>a {
    border-bottom: 2px solid #f6ce53;
}
div.header-nav li a:hover{
	color:#00007d;
}

 

#1. Hover: Change nav item color or underline color?

Same color or different color?

#2. Mobile

Use this code

[data-folder="root"]>div div {
    background-image: none !important;
}
[data-folder="root"]>div a {
    display: inline-block;
}
[data-folder="root"]>div>div:nth-child(1)>a {
    border-bottom: 2px solid #e72F80;
}
[data-folder="root"]>div>div:nth-child(2)>a {
    border-bottom: 2px solid #9438b9;
}
[data-folder="root"]>div>div:nth-child(3)>a {
    border-bottom: 2px solid #00007d;
}
[data-folder="root"]>div>div:nth-child(4)>a {
    border-bottom: 2px solid #f7f8;
}
[data-folder="root"]>div>div:nth-child(5)>a {
    border-bottom: 2px solid #f6ce53;
}

 

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

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.