Archived topic
Should first-child and last-child margins be restored on mobile?
3 replies · Started by Nik on January 6, 2020
Just a suggestion here - could be totally wrong! I'm using a menu widget in the footer bar and by default, GP strips the left margin of the first child and the right margin of the last, exactly as you'd want.
But on mobile, when the menu items drop to a second or third row, those same tweaks knock off the balance because two of the items are effectively not centred. I can reinstate them with CSS of course but I was wondering if this could/should be done in the theme by default?
Or are there other implications that I've missed?
Keep up the good work!
Hi there,
Nice catch! I'll get this added in 2.5.0 :)
For now, you can use this:
@media (max-width: 768px) {
.footer-bar .widget_nav_menu li:first-child {
margin-left: 10px;
}
.footer-bar .widget_nav_menu li:last-child {
margin-right: 10px;
}
}
Thank you!
Ace! Thank you Tom. :)
No problem! Thanks again for letting us know :)