JasmineFoster Posted February 19, 2022 Share Posted February 19, 2022 (edited) 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): The visitor is currently on the HOME page, which in the nav bar "HOME" is in Black font. The visitor is also currently hovering over "WHO WE ARE", which is also in Black font on the nav bar. 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? Edited February 19, 2022 by EnrichedEducator pressed enter on accident and wasn't done crafting my post. Beyondspace 1 Link to comment
kernholz Posted October 27, 2022 Share Posted October 27, 2022 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
Beyondspace Posted October 27, 2022 Share Posted October 27, 2022 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): The visitor is currently on the HOME page, which in the nav bar "HOME" is in Black font. The visitor is also currently hovering over "WHO WE ARE", which is also in Black font on the nav bar. 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? It seems that you have figured it out, right? JasmineFoster and mdrockeyopu 2 BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox, video lightbox and much more) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace (+100 Spark plugin customisations) 🥳 Freemium Squarespace Widget Templates (+1000 Elfsight 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
JasmineFoster Posted October 28, 2022 Author Share Posted October 28, 2022 On 10/27/2022 at 9:11 AM, bangank36 said: It seems that you have figured it out, right? Yup! Thank you Beyondspace 1 Link to comment
kernholz Posted November 9, 2022 Share Posted November 9, 2022 hey Could you tell me by any chance which code you used? that would be very helpul for us. Thank youuu JasmineFoster 1 Link to comment
tuanphan Posted November 12, 2022 Share Posted November 12, 2022 On 11/9/2022 at 7:30 PM, kernholz said: hey Could you tell me by any chance which code you used? that would be very helpul for us. Thank youuu What is your site url? We can take a look JasmineFoster 1 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
Solution JasmineFoster Posted March 8 Author Solution Share Posted March 8 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} mdrockeyopu and Williamson45675 2 Link to comment
JasmineFoster Posted March 13 Author Share Posted March 13 1 hour ago, Williamson45675 said: What a brilliant approach! I'll be implementing this right away. Glad I could help! Let me know how it works out 🙂 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment