button scaling strange on mobile display
-
Please see screenshot of the button that showing on the mobile, it’s not scaling properly
-
Hi @freelylw,
Thanks for reaching out to us!
I do see in your screenshot that the “Submit” button is very narrow.
Would you mind sharing the URL of the page on your site that has this problem, so we can take a further look?
Hi, please see the link here link here there is no problem for showing on desktop but only problem on mobile
Thanks for the link @freelylw.
It looks like you have added some custom CSS to your site using the Simple Custom CSS and JS plugin.
I see you have added this code to increase the left padding for the columns:
.hentry .entry-content .wp-block-columns .wp-block-column:not(:last-child), .columnborder { padding-left: 100px; }
Link to image: https://d.pr/i/KFllUcWe would need to change that column padding for mobile devices, as it prevents the button from displaying correctly. The button width was also set to 50% in the WP-Admin, which works great on desktop but not so much on mobile it seems.
Please add the following code to the Appearance > Customize > Additional CSS section of your WP-Admin dashboard or via the Simple Custom CSS and JS plugin you seem to be using:
/* Fix button width and spacing on mobile | wpniall-wporgforums */ @media only screen and (max-width: 767px) { .hentry .entry-content .wp-block-columns .wp-block-column:not(:last-child), .columnborder { padding-left: 55px!important; padding-right: 45px!important; } .wp-block-buttons>.wp-block-button.wp-block-button__width-50 { width: calc(100% - .5em); } }It should look something like this on an iPhone, for example:
Link to image: https://d.pr/i/QpDjDJPlease let us know if you need any further help!
hi, thanks , but the code seems doesn’t work in android, my android phone still looks the same like before.
Hi @freelylw,
I had a look at your site using my browser’s developer tools and cannot seem to find the code I shared above.
Do you have any kind of caching active on your site? If so, I recommend clearing the cache to see if that helps.
If that does not get the code to work, could you please try adding the CSS code I shared above to the Appearance > Customize > Additional CSS section of your WP-Admin dashboard ?
After you have added the code there, please select the mobile preview option from the bottom section of the customizer to see if the button style changes:
Link to image: https://d.pr/i/y3tDbmHi @freelylw,
Hope you managed to get the code working. We haven’t heard back from you for a while, so I’m going to mark this post as resolved. If you have any further questions or need additional help with the Storefront theme, please start a new thread and we’ll be able to help you out there.
Thanks!
Hi, Thanks, I added your code into the site again, but the problem still there for my Android phone. the problem has not been solved. Thanks
Thanks for the update @freelylw.
Hmm, I had another look through the code on your site using my browser’s developer tools but still could not find the code I shared.
How have you added the code to your site? Also, if you have any caching or script minifying set up on your site, I recommend clearing those, as it’s possible your server is still using an older version that does not contain the new code.
Hi, probably there was some cache problem, I can see it works now on my android phone, thank you
Hi @freelylw,
Glad to hear that and thanks for the update! Yes, it was likely a caching problem then, and the buttons are not displaying correctly on my phone too.
I’ll go ahead and mark this post as resolved. If you have any further questions or need additional help with the Storefront theme, please start a new thread and we’ll be able to help you out there.
Thank you!
The topic ‘button scaling strange on mobile display’ is closed to new replies.
