如何去除Blogger移动端文章及模板下方的空白区域?
Let’s work through those two frustrating mobile blank space issues on your Blogger site—here’s actionable steps to fix them:
1. Trim Extra Space Below Blog Posts on Mobile
The blank area under your mobile posts is almost certainly coming from excess padding or margins on post-related elements. Add this CSS to your template’s custom styles:
@media only screen and (max-width: 768px) { /* Tighten up post body bottom margin */ .post-body { margin-bottom: 15px !important; /* Adjust this number to your preference */ } /* Remove unnecessary padding/margin from post footers */ .post-footer { padding-bottom: 0 !important; margin-bottom: 0 !important; } }
This targets screens 768px and smaller (standard mobile breakpoints) and reduces the unused space below your content.
2. Eliminate the Mobile-Only Footer Blank Space
Your earlier .footer-outer {display:none;} code likely failed because either that selector doesn’t exist in your template, or higher-priority styles are overriding it. Try these alternatives:
If you want to hide the entire footer section on mobile:
@media only screen and (max-width: 768px) { #footer-wrapper { display: none !important; height: 0 !important; overflow: hidden !important; } /* Double-check body margins in case that's contributing */ body { margin-bottom: 0 !important; padding-bottom: 0 !important; } }
If you just want to remove extra space (not the footer itself):
@media only screen and (max-width: 768px) { .footer-outer, #footer-wrapper { padding: 0 !important; margin: 0 !important; min-height: 0 !important; } }
How to Add This CSS to Blogger:
- Head to your Blogger dashboard → Theme → Customize → Advanced → Add CSS
- Paste the code into the text box and click Apply to Blog
Pro tip: Use your browser’s dev tools (right-click the blank space → Inspect) while in mobile view to pinpoint exactly which element is causing the extra space. This will let you target the correct selector with even more precision.
内容的提问来源于stack exchange,提问作者user11426239

