All things Shopify and commerce
Hi!
I have done this before, but not in the pipeline theme, I am not sure if that is the problem or not! By chance, does anyone know how to change the color of one menu bar item (SALES) to red?
I tried this:
.nav-bar__item a[href="/collections/2023-gift-guide"] { color: red; }
However, it did not work! Does anyone have any suggestions?
Our website : maisondavis.ch
Thanks in advance
Solved! Go to the solution
This is an accepted solution.
Under the header try adding the following CSS into the custom CSS field.
To change the "SALES" menu item to red, use this CSS targeting its specific link:
/* Target the SALES menu item by its URL */
.navlink[href="/collections/sales"] .navtext {
color: red !important;
/* If needed, also change hover color: */
transition: color 0.2s;
}
.navlink[href="/collections/sales"]:hover .navtext {
color: #cc0000 !important;
}
Explanation:
Uses an attribute selector [href="/collections/sales"] to target the specific menu item
Targets the text element with class .navtext
!important ensures it overrides existing styles
Added hover state for better interaction
Pro Tip: If your theme uses CSS variables, you could alternatively override the color variable:
.navlink[href="/collections/sales"] {
--navtext-color: red !important;
}
Hope that helps.
✅ Found this helpful? Please Like & Mark as Solution — I truly appreciate it!
Connect with me | Get a Shopify Store with an Unlimited Free Trial – No Credit Card Needed! | ❤️ Support my work, If You’d Like!
Hello @JulianDavis
1.Go to Shopify Admin → Online Store → Themes.
2.Click "Edit Code" on your active theme.
3.Open base.css, theme.css, or stylesheet.css (whichever your theme uses in the assets folder).
4.Scroll to the bottom of the file.
5.Paste the CSS code above.
.site-nav__link[href="/collections/2023-gift-guide"],
.nav-bar__item a[href="/collections/2023-gift-guide"] {
color: red !important;
}
6.Click Save and refresh your site.
Thank you 😊
Hey @JulianDavis
Ensure the correct URL path is used
right-click the SALES menu item on your website.
. Select Inspect and check the exact href value in the <a> tag.
. The href might not be /collections/sales; it could be something like /pages/sales or a different collection name.
. Try a more specific selector
If the original CSS doesn’t work, try this alternative:
a.site-nav__link[href*="sales"],
.nav-bar__item a[href*="sales"] {
color: red !important;
}
. This targets any link that contains "sales" in the URL, even if it’s /collections/sales, /pages/sales, or something else.
. do a Hard Refresh
After saving, you should press Ctrl + Shift + R (Windows) or Cmd + Shift + R (Mac) to clear the cache and see the changes.
Thank you 😊
Thank you very much Goldie,
I tried a lot of alternative but unfortunately it didn't work..
When I inspect the link, here is what I find:
<a href="/collections/sales" data-top-link="" class="navlink navlink--toplevel">
<span class="navtext">SALES</span>
</a>
<span class="navtext">SALES</span>
Do you see a reason why it wouldn't work?
Thank you again
Hey @JulianDavis
Based on the inspected HTML you provided, your original CSS didn’t work likely because of class specificity. Try this updated CSS:
.navlink.navlink--toplevel[href="/collections/sales"] {
color: red !important;
}
Explanation:
. . navlink.navlink--toplevel is the class assigned to your menu items.
. [href="/collections/sales"] ensures we are only targeting the SALES menu item.
. !important forces the style to override other CSS rules.
If That Doesn't Work:
Try this alternative, which specifically targets the <span> inside the link:
.navlink.navlink--toplevel[href="/collections/sales"] .navtext {
color: red !important;
}
Final Steps:
1. Add the CSS to your theme (Online Store → Themes → Customize → Edit Code → theme.css or base.css).
2. Save the file.
3. Hard Refresh the page (Ctrl + Shift + R on Windows or Cmd + Shift + R on Mac) to clear cache and see the update.
Thank you 😊
This is an accepted solution.
Under the header try adding the following CSS into the custom CSS field.
To change the "SALES" menu item to red, use this CSS targeting its specific link:
/* Target the SALES menu item by its URL */
.navlink[href="/collections/sales"] .navtext {
color: red !important;
/* If needed, also change hover color: */
transition: color 0.2s;
}
.navlink[href="/collections/sales"]:hover .navtext {
color: #cc0000 !important;
}
Explanation:
Uses an attribute selector [href="/collections/sales"] to target the specific menu item
Targets the text element with class .navtext
!important ensures it overrides existing styles
Added hover state for better interaction
Pro Tip: If your theme uses CSS variables, you could alternatively override the color variable:
.navlink[href="/collections/sales"] {
--navtext-color: red !important;
}
Hope that helps.
✅ Found this helpful? Please Like & Mark as Solution — I truly appreciate it!
Connect with me | Get a Shopify Store with an Unlimited Free Trial – No Credit Card Needed! | ❤️ Support my work, If You’d Like!
THANK YOU IT WORKED!!!
I also noticed I had to adjust the link according to the language I'm usingon the website
For exemple, for the french version, I needed to add /fr/collections/sales
anyway, it works perfectly, thank you very much!!
New problem unlocked:
On the mobile, it doesn't has the red color...
Any trick?
Give this a try.
/* Target SALES menu item on mobile */
.sliderow__title[href="/collections/sales"] {
color: red !important;
}
/* Optional: Change color on hover */
.sliderow__title[href="/collections/sales"]:hover {
color: #cc0000 !important;
}
Hope that helps.
✅ Found this helpful? Please Like & Mark as Solution — I truly appreciate it!
Connect with me | Get a Shopify Store with an Unlimited Free Trial – No Credit Card Needed! | ❤️ Support my work, If You’d Like!
In Canada, payment processors, like those that provide payment processing services t...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025