How do you centre the test in the mega menu?
Topic summary
A user needed help centering text in their Shopify store’s mega menu sidebar, sharing a screenshot showing the alignment issue.
Solution Provided:
After the user shared their store URL, a support team member provided CSS code to be added to the theme.liquid file above the </head> tag:
- Desktop fix: CSS targeting
.mega-menu-sidebar--content > ul > li > a > spanwithtext-align: center !important; - Mobile fix: Additional media query code for screens under 768px width, using
margin-inline: auto !important;on the span elements
Outcome:
The desktop solution worked successfully. The user then requested mobile alignment help, received the appropriate code, and confirmed the issue was resolved. The discussion reached full resolution with working solutions for both desktop and mobile views.
Hi @GediminasS
Thank you for reaching out to the Shopify community. I’d be glad to assist you. Could you kindly share your store URL and password (if it’s password-protected) so I can review it and provide you with an update?
Hello @GediminasS ,
Could you please provide the URL/ password to your store so that I can check it and provide you with the exact solution?
Hi @GediminasS
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 %}
.mega-menu-sidebar--content > ul > li > a > span {
text-align: center !important;
}
{% endstyle %}
Please let me know if it works. Thank you!
Best,
Daisy - Avada Support Team
Hi,
thanks for this. It did worked on PC, how do we do that on mobile as well?
Hi @GediminasS
{% style %}
@media screen and (max-width: 768px){
.mega-menu-sidebar--content > ul.sub-menu > li > a span {
margin-inline: auto !important;
}
}
{% endstyle %}
This is the code for mobile
Please let us know if our reply is helpful by giving it a Like or marking it as a Solution!
Thank you!


