I would like to change our ‘SALE’ button on our menu to the colour red, I have tried multiple types of code found in other answers for the same question but I think it may change from theme to theme.
I’m using the Momentum theme, and it doesn’t seem to have to correct .css files under assets when I go to edit the code. The website is statementnz.com , if that is any help.
Any suggestions would be appreciated!
There are 2 ways to do this:
First Way
-
Go to Online Store->Themes->Edit Code
-
Locate the file ‘theme.min.css’
-
At the end of the file paste the below code
.first-level-dropdown:nth-child(5) a span {
color: red;
}
This will work, but it’s not very efficient because if you want to change its position, you’ll always have to update the number inside the parentheses.
Second Way
The second way to achieve this is by finding the Liquid code for the menu and adding a separate class name to the ‘SALE’ menu item. This way, you can target it easily without using the nth-child() property.
1 Like
This is wonderful, the first way works for desktop perfectly. Is there a way to make it work for mobile as well?
Yea of course. Add the below code at the end of the ‘theme.min.css’ file.
.mobile-nav__item.top-level:nth-child(5) a {
color: red !important;
}
Also if you want to add the hover effect in desktop add the below code again at the end of the ‘theme.min.css’ file
.first-level-dropdown:nth-child(5) a:hover span{
color: #ff5c5c; /* Modify the color according to your preference */
}