This page is for people who write a little code. Not sure whether you need CSS at all? Read Built-in settings or custom CSS? first.
The idea: Navi+ adds the menu’s code for you
Each Navi+ menu has its own code, like #SF-123456789. When you type CSS into a Navi+ box, the app puts this code in front of every line. So your CSS only touches that menu, and it can’t spread to the rest of your store.
You write this:
.name { color: red; }
Navi+ turns it into this:
#SF-123456789 .name { color: red; }
So you don’t type #SF-…, and you don’t wrap the code in a <style> tag. Just write plain CSS.
Which box to use
| Box | Where | Affects |
|---|---|---|
| Custom CSS for this menu | Configure step | The whole menu |
| CSS in an item | Edit item, in the advanced part | That one item. The CSS moves with the item when you duplicate it |
| Reusable Classes (CSS) | Configure step | Any item you give the class name to |
| Global CSS | Configure step | Your whole store |
Use the first box for most work. The Global CSS box has no protection: whatever you write there applies to your whole store, so keep it for changes that really aren’t about the menu.
Use & for “this menu” or “this item”
The & sign means the thing the box belongs to: the menu in Custom CSS for this menu, or the item in an item’s CSS box.
& { background: #111; } /* the menu or item itself */
&:hover { opacity: .9; } /* when hovered */
& .name { font-weight: 700; } /* the name inside it; same as .name { … } */
Inside @media you must use & to reach the menu or item itself:
@media (max-width: 768px) {
& { padding: 6px; }
.name { font-size: 12px; }
}
A line with only a property and no selector, such as color: red;, still works in an item’s box, but not inside @media. Use & instead.
Style one level
Menus have three levels. Use the content box of each level:
.inner-level1 .name { font-size: 14px; }
.inner-level2 .name { font-size: 16px; }
.inner-level3 .name { font-size: 13px; }
For the full list of class names, see CSS class reference.
Check your code
- Save the menu, then open your real store. The preview in the app can look slightly different.
- Right-click the part you changed and choose Inspect. Check that the class names in your code appear on the page.
- Still nothing? Look at the common causes below.
When your CSS does nothing
A Design box is overriding it
If a property is set both in CSS and in a Design box or the item’s own settings, the box wins. Clear the box, or add !important to your rule.
You wrote #SF-… or a style tag
Remove them. Navi+ adds the menu code itself, and a <style> tag in the box breaks the code. If you add CSS to your theme files instead, you do need to type the full #SF-… code.
The code is in the wrong box
Code in Custom CSS for this menu can only reach inside that menu. To change something outside the menu, such as another app’s chat button, use Global CSS.
The page still looks old
Save, then reload the store and clear the page’s cache. If the change still doesn’t show, see Changes don’t show on my store.
The class name isn't on the page
Class names depend on the menu type, and a few are internal and can be renamed by an update. Check the live page with Inspect, and prefer the stable names listed in the CSS class reference.