Mastering Your Shopify Header: How to Easily Change Main Menu Font Size
Hey fellow store owners! Ever found yourself staring at your Shopify store, thinking, "This looks good, but I just need to tweak that one thing to make it perfect?" We've all been there. Recently, a fantastic discussion popped up in the Shopify community that really hit home for many of you: how to adjust the main menu font size in your header.
Our friend Filpup, who runs the awesome handmade dog clothes store FILPUP (you can check them out at https://filpup.com/ – seriously, those pet barongs are adorable!), was trying to make their header navigation stand out. They had a specific look in mind, attempting to use some custom CSS like this to get a larger, bolder, uppercase font:

#shopify-section-sections--18158375403629__header .list-menu__item {
font-size: 20px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.8px;
}
But, as often happens with custom code, it wasn't quite working as expected. This is a super common scenario because Shopify themes, while powerful, can sometimes be a bit tricky with their CSS selectors, especially when dealing with dynamically generated IDs.
The Easiest Path: Your Theme Customizer (No Code Needed!)
Before diving into any code, my absolute first piece of advice, echoed by community expert mastroke, is always to check your theme's built-in customization options. Shopify themes are getting incredibly flexible, and many modern themes offer direct controls for typography. It's truly the simplest way to go!
Here's how to check:
- Go to your Shopify Admin.
- Navigate to Online Store → Themes.
- Find your current theme and click the Customize button.
- Once in the Customizer, click on the Header section in the left sidebar.
- Now, look for settings related to “Navigation font size”, “Menu” typography, or similar. Theme developers often put these controls right there for you.
- If you find it, simply adjust the size directly – no code needed, no fuss!
This method is fantastic because it's safe, updates gracefully with your theme, and doesn't require any technical know-how. Always start here!
When the Customizer Isn't Enough: Diving into Custom CSS
Sometimes, your theme's customizer might not offer the exact control you need, or maybe you're aiming for a very specific look that requires a custom touch. That's when custom CSS comes into play. Both mastroke and Dan-From-Ryviu offered excellent insights here, and there's a key detail to understand.
Filpup's original code snippet used a selector like #shopify-section-sections--18158375403629__header. See that long number? That's a dynamically generated ID that Shopify assigns to sections. The problem is, these IDs can change! They're not reliable for long-term custom CSS because a theme update or even a small change to your store's structure could render that ID invalid, breaking your styling.
The Robust Solution: Using a Stable Selector
Community member mastroke provided a much more stable and recommended CSS selector that targets the header menu elements more generally, without relying on those fickle dynamic IDs. This is the approach I'd recommend for longevity:
- Go to your Shopify Admin.
- Navigate to Online Store → Themes.
- Find your current theme, click Actions, then Edit Code.
- Look for a file named
base.css,theme.css, or sometimes a dedicatedcustom.cssfile. If your theme has a 'Custom CSS' section in the theme customizer, that's often the safest and easiest place to add it. - Add the following code snippet, ideally at the bottom of the file (or in your Custom CSS section):
/* Main nav menu font */
.header__inline-menu .list-menu--inline .list-menu__item--link {
font-size: 20px !important;
font-weight: 600 !important;
text-transform: uppercase !important;
letter-spacing: 0.8px !important;
}
Notice the !important flag after each property? This is a CSS 'trump card' that tells the browser, 'Hey, this style must be applied, even if there are other conflicting styles with higher specificity.' While generally good practice to avoid overusing it, in cases like overriding theme defaults where you're not sure of the exact specificity chain, it's a helpful tool to ensure your styles stick.
A Simpler Override (Use with Caution)
Dan-From-Ryviu offered a more concise override specifically for the font size, using the original selector but adding !important. While this can work, remember the dynamic ID issue. If you're only changing the font size and need a quick fix, this could be added to your Custom CSS:
#shopify-section-sections--18158375403629__header .list-menu__item {
font-size: 20px !important;
}
However, I'd still lean towards mastroke's more general selector for better future-proofing.
A Few Important Pointers:
- Always Backup: Before making any code changes, it's smart to duplicate your theme. Go to Online Store → Themes → Actions → Duplicate. This way, if something goes wrong, you can quickly revert.
- Test on Different Devices: What looks great on a desktop might not look so hot on a mobile phone. Always check your changes on various screen sizes to ensure your navigation remains readable and well-formatted.
- Where to Add Custom CSS: Most modern Shopify themes have a dedicated 'Custom CSS' field within the theme customizer (Online Store → Themes → Customize → Theme settings → Custom CSS). This is the absolute best place for snippets like these, as it keeps your changes separate and makes theme updates easier. If your theme doesn't have this, then adding it to a file like
base.cssortheme.cssis the next best option, but remember to be careful.
It's awesome to see the community coming together to solve these common design challenges. Whether you go the no-code route with the theme customizer or roll up your sleeves with some custom CSS, getting your header navigation just right can make a huge difference in your store's professionalism and user experience. Happy customizing!