How can I align all items in my hamburger menu to the center?

Solved

How can I align all items in my hamburger menu to the center?

ddai
Excursionist
22 0 2

Can any of you help me center all of the items in my hamburger menu. I have added code to make the menu open across the whole screen, now i just need the links to be lined up in the middle like how the logo is. i have included picture of what i am looking to do . my site is ysamani.com thank you for any and all help. 

 

ddai_0-1684199824159.png

 

Accepted Solutions (2)

ZestardTech
Shopify Partner
5776 1052 1392

This is an accepted solution.

Hello There,
1. In your Shopify Admin go to online store > themes > actions > edit code
2. Find Asset -> base.css and paste this at the bottom of the file:

.list-menu__item {
    display: inherit!important;
    text-align: center;
}

ZestardTech_0-1684220732338.png

 

 

Want to modify or develop new app, Hire us.
If helpful then please Like and Accept Solution .
Email: support@zestard.com
Shopify Apps URL :- https://apps.shopify.com/partners/zestard-technologies
Custom Modifications Into Shopify Theme | Shopify Private App | SEO & Digital Marketing

View solution in original post

INA_MSWEB
Shopify Partner
1281 144 164

This is an accepted solution.

Hi @ddai 


I hope you are doing good and welcome to the Shopify Community!
I am San from MS Web Designer.

Please add this css in your bottom of the css file:
.menu-drawer__menu .list-menu__item {justify-content: center;}

 

 

 

Regards,

San

If it’s helpful to you, please mark it as a solution.  


Need Help with Shopify Design, Migration, Speed, or Custom tasks?  
email: hi@mswebdesigner.com
Try Our Conversion Booster app to get more sales | Connect Our Founder Linkedin

View solution in original post

Replies 7 (7)

AliReviews
Shopify Partner
773 90 356

Hello @ddai ,

 

You can try to follow these steps:

  • Go to Online Store -> Themes -> Actions -> Edit code
  • Go to Assets folder -> go to the file that contains your hamburger menu code. This is usually named something like "theme.js" or "scripts.js".
  • Find the code that controls the styling of your hamburger menu. This could be a class or ID assigned to the menu element, or it could be a specific section of the code that begins with something like $(".hamburger-menu").click(function(){.
  • Add the following code to center the items in your hamburger menu:
var menuWidth = $(".mobile-nav__list").width();
var windowWidth = $(window).width();
var offset = (windowWidth - menuWidth) / 2;
$(".mobile-nav__list").css("left", offset);
  • Save and preview 

Hope this can help. Let us know if you need any further support.

Ali Reviews team.

- Was my answer helpful? Please hit Like or Mark it as solution!
- Ali Reviews - The must-have Shopify app that empowers you to effortlessly collect, display, and manage product reviews.
- Start your FREE trial today!
ddai
Excursionist
22 0 2

I am not sure where to put it. I have tried under component_menu_drawer.css and theme-editor.js with no luck

StoreWatchers
Trailblazer
205 30 37


Hi, @ddai 

 

Greetings from the Store Watchers Support Team! Happy to help you today.

 

1. Go to online store > theme > edit code > assets > base.css(file) and Paste the below code at the bottom of the file -> Save

.menu-drawer__menu .list-menu__item {
    justify-content: center;
}

 

After applying the above CSS code , it will show like the following screenshot:

Screenshot_2.png

 

Let me know If need further assistance

 

Regards,

Store Watchers Support Team

 

StoreWatchers - Automate testing for your Shopify store in seconds


If you find my reply helpful, please hit Like and Mark as Solution
Visit us: App Store | Website | FAQs
ddai
Excursionist
22 0 2

You all are the best. Thank you !

ZestardTech
Shopify Partner
5776 1052 1392

This is an accepted solution.

Hello There,
1. In your Shopify Admin go to online store > themes > actions > edit code
2. Find Asset -> base.css and paste this at the bottom of the file:

.list-menu__item {
    display: inherit!important;
    text-align: center;
}

ZestardTech_0-1684220732338.png

 

 

Want to modify or develop new app, Hire us.
If helpful then please Like and Accept Solution .
Email: support@zestard.com
Shopify Apps URL :- https://apps.shopify.com/partners/zestard-technologies
Custom Modifications Into Shopify Theme | Shopify Private App | SEO & Digital Marketing

INA_MSWEB
Shopify Partner
1281 144 164

This is an accepted solution.

Hi @ddai 


I hope you are doing good and welcome to the Shopify Community!
I am San from MS Web Designer.

Please add this css in your bottom of the css file:
.menu-drawer__menu .list-menu__item {justify-content: center;}

 

 

 

Regards,

San

If it’s helpful to you, please mark it as a solution.  


Need Help with Shopify Design, Migration, Speed, or Custom tasks?  
email: hi@mswebdesigner.com
Try Our Conversion Booster app to get more sales | Connect Our Founder Linkedin

ddai
Excursionist
22 0 2

You all are the best. Thank you !!