Fit footer widgets inside viewport mobile
-
Hi,
I am using the Astra theme (free). My website looks good on mobile except the footer widgets do not fit inside the viewport on mobile devices. Rather than being centered and full-width, they are cut off and float slightly right. I found this code on the web. How do I adjust it to make all footer widgets fit inside the viewport on smaller screens?
Here are two separate lines of code.
Code 1:
@media (max-width: 768px) { /* Adjust breakpoint as needed for mobile devices / / Styles for the entire footer widget area / .footer-widgets { padding: 15px; / Add some padding around the widgets / overflow-x: hidden; / Prevent horizontal scrolling if content overflows */
}
/* Styles for individual footer widgets */
.footer-widgets .widget {
margin-bottom: 20px; /* Add space between widgets */
width: 100%; /* Make widgets take full width on mobile */
box-sizing: border-box; /* Include padding and border in the element's total width */
}
/* Example: Adjust font sizes for readability on mobile */
.footer-widgets .widget-title {
font-size: 1.2em;
}
.footer-widgets .textwidget {
font-size: 0.9em;
}
}Code: 2
@media (max-width: 768px) {
.footer-widgets .menu {
list-style: none;
padding: 0;
text-align: center; /* Center menu items */
}
.footer-widgets .menu li {
margin-bottom: 10px;
}
}The page I need help with: [log in to see the link]
-
An email opt-in form was stretching the footer. The issue is resolved.
Hey @fantasy_5,
I was on your site (lovely site, btw😊), trying to get a solution to the issue, then I reloaded the page, and it seems you’ve managed to fix the issue.
If you wouldn’t mind, could you share how you did it to help users in the future with a similar query?
Seems you already have.Have a lovely day.
Kind Regards,
ErickHi @fantasy_5,
Thank you for the update! I’m glad that you were able to figure it out.
Don’t hesitate to reach out if you need any further assistance in the future.
Kind regards,
Aradhy 😊Hi,@r1k0
Thanks so much for the compliment. Yes, I was able to fix the issue by adjusting the form size in the footer. It was a custom size that looked great on desktop, but was outside of the viewport on mobile. I set it to auto-sizing instead. Thank you for getting back to me. @bsfaradhy
You must be logged in to reply to this topic.
