Jump to content

Highlight Current Page/Folder in Navigation Bar - Brine

Go to solution Solved by EnrichedEducator,

Recommended Posts

Site URL: https://www.theenrichededucator.org/

Hello, I am trying to figure out some CSS that will highlight the appropriate item on my header/navigation bar with a visitor is currently on one of the pages in the folder. I have switched the Style Editor setting to "Active" already. This works for regular pages in my navigation bar; turns the item from Red font to Black font when the visitor hovers and/or is currently on the page. However, this effect does not work when the visitor is on a page within a folder; the hover effect works but the Navigation Item doesn't stay in Black font. I should note that the pages within my dropdown folders are links to non-linked pages in my site. 

I am using Brine 7.0 and have some basic/intermediate knowledge of CSS. 

My ideal outcome would be (using the screenshot below):

  1. The visitor is currently on the HOME page, which in the nav bar "HOME" is in Black font.
  2. The visitor is also currently hovering over "WHO WE ARE", which is also in Black font on the nav bar.
  3. Currently, what happens when the visitor clicks on "OUR TEAM", the visitor will be taken to that folder link (which is an anchor text within a non-linked index page) and the nav bar item "WHO WE ARE" stays in Red font. What I'd like to happen when the visitor is on this page (and others like it) is for the nav bar item to be in Black font.

Is this achievable with some CSS?

Screen Shot 2022-02-19 at 11.49.32 AM.png

Edited by EnrichedEducator
pressed enter on accident and wasn't done crafting my post.
Link to comment
  • 8 months later...

hey, I seem to have the same problem you were writing about. I tried CSS with this code

/* nav active color */
.header-nav-item--active>a, .header-nav-folder-item--active>a, .header-menu-nav-item--active>a .header-menu-nav-item--active {
    color: #1cc700 !important;
}

It does not work with my page. Did you find another solution?

Link to comment
On 2/19/2022 at 11:39 PM, EnrichedEducator said:

Site URL: https://www.theenrichededucator.org/

Hello, I am trying to figure out some CSS that will highlight the appropriate item on my header/navigation bar with a visitor is currently on one of the pages in the folder. I have switched the Style Editor setting to "Active" already. This works for regular pages in my navigation bar; turns the item from Red font to Black font when the visitor hovers and/or is currently on the page. However, this effect does not work when the visitor is on a page within a folder; the hover effect works but the Navigation Item doesn't stay in Black font. I should note that the pages within my dropdown folders are links to non-linked pages in my site. 

I am using Brine 7.0 and have some basic/intermediate knowledge of CSS. 

My ideal outcome would be (using the screenshot below):

  1. The visitor is currently on the HOME page, which in the nav bar "HOME" is in Black font.
  2. The visitor is also currently hovering over "WHO WE ARE", which is also in Black font on the nav bar.
  3. Currently, what happens when the visitor clicks on "OUR TEAM", the visitor will be taken to that folder link (which is an anchor text within a non-linked index page) and the nav bar item "WHO WE ARE" stays in Red font. What I'd like to happen when the visitor is on this page (and others like it) is for the nav bar item to be in Black font.

Is this achievable with some CSS?

Screen Shot 2022-02-19 at 11.49.32 AM.png

It seems that you have figured it out, right?

image.thumb.png.ec0bd441f470446f4e52715ee2153d3d.png

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
  • 2 weeks later...
  • 1 year later...
  • Solution
On 11/9/2022 at 7:30 AM, kernholz said:

hey Could you tell me by any chance which code you used? that would be very helpul for us. Thank youuu

Hi, I know I am very delayed in my response, but here is the code I am using. Since my original post, I have made some additional updates to my navigation bar.  I've pasted my updated code below. I hope this helps!

//NAVIGATION BAR//

	// Hide index link from nav bar //
 		a[href="/sip-the-tee-1"]{pointer-events: none;};
 		a[href="/about-nav"]{pointer-events: none;}
 		a[href="/what-we-do-1"]{pointer-events: none;}
	
	//static floating header//
		.Header {border-bottom: 2px solid gray;}

		@media screen and (min-width: 768px) {
          .Header {position: fixed; z-index: 9999; width: 100%; top: 0px;}
          .Content-outer {margin-top: 100px;}
		}

	//--- Add a border between links:
		.Header-nav-folder a {border-bottom:1px dotted gray}

	//--- Increase the space between links:
		.Header-nav-folder a {padding-bottom:.5rem!important; }

	//--- give drop down list a shadow:
		.Header-nav-folder{box-shadow: 5px 5px 15px rgba(0,0,0,0.5)} 
		.Header-nav-folder{background-color:white!important}

	//--- active link highlight---//
		.Header-nav-item {margin: 10px!important; padding: 5px!important;}
		.Header-nav-item:hover {border: 2px solid #990000!important;}
		.Header-nav-item.Header-nav-item--active {background: #990000!important; color: white!important}
		.Header-nav-folder-title.Header-nav-folder-title--active{
      		color: white!important;
    		background-color: #990000;
   			padding-left: 6px;
    		padding-right: 5px;
    		border: 4px solid #990000;
    		margin-left: -5px!important;
    		margin-right: -5px;
    		margin-top: -2px;}
	//--- grey highlight folder link on hover---//
		.Header-nav-folder-item:hover {background-color: #e7e6e6!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.