Jump to content

Custom navigation button with folder issue

Recommended Posts

Site URL: https://plenitudpr.org

Hi!

I have a multilingual site with 2 folders for each language, 1 folder on the primary navigation and 1 folder on the secondary navigation. I wanted to add a call to action button to the right of the header and added this code.

// Last 2nd Nav Item Orange Button //
.Header-nav.Header-nav--secondary a:last-child {
    background-color: #ffffff; /* button color */
      color: #ea7c3a; /* text color */
      border: 2px solid #ea7c3a;
    padding: 15px !important;
    border-radius: 2px,  
}

// Last 2nd Nav Item Orange Button HOVER //
.Header-nav.Header-nav--secondary a:last-child {
  background-color: #fafafa;
  color: #ea7c3a;
  border: 2px solid #ea7c3a;
}
.Header-nav.Header-nav--secondary a:last-child:hover {
  background-color: #ea7c3a;
  color: white;
}

The button turned out great, however, the last item inside the folder I have on the secondary navigation is displaying the same formatting. How can I fix this so that the button formats only show on the call to action (secondary navigation item), and not inside the last folder item.

Any help is greatly appreciated!

Link to comment
  • Replies 2
  • Views 370
  • Created
  • Last Reply

Edit to

// Last 2nd Nav Item Orange Button //
.Header-nav.Header-nav--secondary a[href="/donate"] {
    background-color: #ffffff; /* button color */
      color: #ea7c3a; /* text color */
      border: 2px solid #ea7c3a;
    padding: 15px !important;
    border-radius: 2px,  
}

// Last 2nd Nav Item Orange Button HOVER //
.Header-nav.Header-nav--secondary a[href="/donate"] {
  background-color: #fafafa;
  color: #ea7c3a;
  border: 2px solid #ea7c3a;
}
.Header-nav.Header-nav--secondary a[href="/donate"]:hover {
  background-color: #ea7c3a;
  color: white;
}

 

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.