Hi, can anyone share with me the code for center aligned header menu (Dawn theme)?
thank you in advance !
Password: meolyo
A user seeks CSS code to center-align the header menu in Shopify’s Dawn theme for their store.
Three solutions provided:
Simple CSS approach (ZestardTech & vm-web):
base.css:.header--middle-left {
grid-template-columns: 1fr auto 1fr !important;
}
Alternative method (DaisyVo):
theme.liquid before </head> tagBoth approaches use CSS grid modifications to achieve center alignment. The first method is simpler with a single CSS rule, while the second provides responsive control and additional flexbox centering for menu items. Screenshots accompany each solution showing expected results.
Hi, can anyone share with me the code for center aligned header menu (Dawn theme)?
thank you in advance !
Password: meolyo
Hello @Daniel19901 ,
Here are the steps to apply the necessary changes in your Shopify store:
.header--middle-left {
grid-template-columns: 1fr auto 1fr !important;
}
Let me know if you need further assistance!
Hi Daniel19901
I hope you are well. You can follow our instructions below:
1/ Shopify admin > Online store > Edit code: https://prnt.sc/M4p-gua99Uf4
2/ Search for “theme.liquid” file: https://prnt.sc/b6xveIKe-Rh2
3/ Open the file and search for tag and add the following code above tag: https://prnt.sc/KWtKYyZkDtYJ
Here is the code for Step 3:
{% style %}
@media screen and (min-width: 1024px){
header.header {
grid-template-columns: auto 1fr auto !important;
}
nav.header__inline-menu ul.list-menu.list-menu–inline {
display: flex !important;
justify-content: center;
}
}
{% endstyle %}
.header--middle-left {
grid-template-columns: 1fr auto 1fr !important;
}
Thanks!