Title: Centering button toggle (Menu mobile)
Last modified: November 24, 2020

---

# Centering button toggle (Menu mobile)

 *  Resolved [TokoDaring.Com](https://wordpress.org/support/users/wpjakarta/)
 * (@wpjakarta)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/centering-button-toggle-menu-mobile/)
 * Hello
 * i was made sticky header for main navigation both on pc or mobile devices. and
   i want the toggle button mobile menu to displayed center when it accessed via
   mobile.
    how can i do that ?
 * please see pict attached [https://i.imgur.com/lXv1bO3.jpg](https://i.imgur.com/lXv1bO3.jpg)
    -  This topic was modified 5 years, 5 months ago by [TokoDaring.Com](https://wordpress.org/support/users/wpjakarta/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcentering-button-toggle-menu-mobile%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 9 replies - 1 through 9 (of 9 total)

 *  [Senff – a11n](https://wordpress.org/support/users/senff/)
 * (@senff)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/centering-button-toggle-menu-mobile/#post-13702898)
 * Hey [@wpjakarta](https://wordpress.org/support/users/wpjakarta/)
 * Try adding this:
 *     ```
       @media screen and (max-width: 767px) {
         #site-navigation {
           text-align: center;
           clear: both;
         }
   
         #site-navigation button {
           float: none;
           margin-top: 15px;
         }
   
         #site-navigation .handheld-navigation {
           text-align: left;
         }
       }
       ```
   
 *  Thread Starter [TokoDaring.Com](https://wordpress.org/support/users/wpjakarta/)
 * (@wpjakarta)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/centering-button-toggle-menu-mobile/#post-13715352)
 * hello [@senff](https://wordpress.org/support/users/senff/)
 * thank for your help, actually your code is work
 * but i forget to explain before that i adding sticky class to main navigation 
   when it scrolled down. and the button will be centered when sticky already active
 *  [Senff – a11n](https://wordpress.org/support/users/senff/)
 * (@senff)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/centering-button-toggle-menu-mobile/#post-13716447)
 * I’m sorry, I’m not sure what you mean exactly. The code I gave you earlier should
   make the button centered also when you scroll down and the menu becomes sticky.
 *  Thread Starter [TokoDaring.Com](https://wordpress.org/support/users/wpjakarta/)
 * (@wpjakarta)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/centering-button-toggle-menu-mobile/#post-13721170)
 * Hello,
    Sory for slow replying your message
 * I mean before it scrolled down the button position still on it original place(
   on left) while the site title remain on the left.
 * My purpose : When user scrolled down and the site title go up then `the time 
   the button will move to center.`
 * Sory im not to fluent in english, and hope you can get what i mean
 *  Thread Starter [TokoDaring.Com](https://wordpress.org/support/users/wpjakarta/)
 * (@wpjakarta)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/centering-button-toggle-menu-mobile/#post-13721173)
 * I have tried adding .`sticky` to the selector become `#site-navigation.sticky`
   but it doesn’t work
 *  [Senff – a11n](https://wordpress.org/support/users/senff/)
 * (@senff)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/centering-button-toggle-menu-mobile/#post-13735611)
 * Hey [@wpjakarta](https://wordpress.org/support/users/wpjakarta/)
 * I’m sorry, I’m still a bit unclear what you mean. If you apply the code I gave
   you, the MENU button will always be centered on mobile devices (when the menu
   is sticky or not). Here is a screencast for your reference:
 * [[
    Image link: [https://d.pr/i/6w4Wgd](https://d.pr/i/6w4Wgd)
 *  Thread Starter [TokoDaring.Com](https://wordpress.org/support/users/wpjakarta/)
 * (@wpjakarta)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/centering-button-toggle-menu-mobile/#post-13766225)
 * Helo [@senff](https://wordpress.org/support/users/senff/)
 * i mean before it sticky the button will still remain on the right (on original
   place)
 * when it scroll and the sticky active then the button will move to center
 *  [Senff – a11n](https://wordpress.org/support/users/senff/)
 * (@senff)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/centering-button-toggle-menu-mobile/#post-13786024)
 * Hey [@wpjakarta](https://wordpress.org/support/users/wpjakarta/)
 * If the button should only be centered when you scroll down, try using this code:
 *     ```
       @media screen and (max-width: 767px) {
         .sticky #site-navigation {
           text-align: center;
           clear: both;
           padding-bottom: 15px;
         }
   
         .sticky #site-navigation button {
           float: none;
           margin-top: 15px;
         }
   
         .sticky #site-navigation .handheld-navigation {
           text-align: left;
         }
       }
       ```
   
 *  Thread Starter [TokoDaring.Com](https://wordpress.org/support/users/wpjakarta/)
 * (@wpjakarta)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/centering-button-toggle-menu-mobile/#post-13806705)
 * hello [@senff](https://wordpress.org/support/users/senff/)
 * Perfectly great!, it work like i want
 * thank you very much

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Centering button toggle (Menu mobile)’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/storefront/4.6.2/screenshot.png)
 * Storefront
 * [Support Threads](https://wordpress.org/support/theme/storefront/)
 * [Active Topics](https://wordpress.org/support/theme/storefront/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/storefront/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/storefront/reviews/)

 * 9 replies
 * 2 participants
 * Last reply from: [TokoDaring.Com](https://wordpress.org/support/users/wpjakarta/)
 * Last activity: [5 years, 4 months ago](https://wordpress.org/support/topic/centering-button-toggle-menu-mobile/#post-13806705)
 * Status: resolved