How to Remove Unwanted White Space in the Twenty Seventeen Theme
Content
One of the most frequent questions from users of the Twenty Seventeen theme is how to eliminate unwanted white space or gaps on their pages. This space can appear above headers, below footers, between posts, or around specific elements like sliders or menus. Based on common community solutions, this guide will help you identify and fix these spacing issues.
Why Does This White Space Appear?
In the Twenty Seventeen theme, white space is typically not a bug but is intentionally added through CSS properties like padding, margin, and positioning. This space is part of the theme's design to create a balanced, readable layout. However, when users modify their site by adding custom elements (like a Meta Slider), removing default ones (like sidebars or post titles), or using page builders, the intended spacing can sometimes become excessive or appear in unwanted places.
Common Solutions Using Custom CSS
The most effective way to adjust this spacing is by adding custom CSS. You can do this by navigating to Appearance > Customize > Additional CSS in your WordPress dashboard. The following code snippets address the most common scenarios reported by users.
1. Remove Space Below a Slider or Specific Plugin Element
If you have an element like the Meta Slider and notice a white bar below it, the plugin's CSS is likely adding padding. To remove it, use a code snippet similar to this:
.ms-theme-radix {
padding-bottom: 0px !important;
}
Note: The CSS selector (e.g., .ms-theme-radix) may change depending on the plugin you are using. Inspect your page with browser tools to find the correct class.
2. Reduce Space Between Posts on the Blog Page
To decrease the large gap between blog posts, target the article elements with this CSS:
.site-content .site-main article {
padding-bottom: 2em; /* Adjust this value to your liking */
}
3. Remove Space Between Page Titles and Content
To minimize the margin below a page or post title, use this code:
.entry-header {
margin-bottom: 12px; /* Adjust this value to your liking */
}
4. Eliminate White Space at the Very Top or Bottom of a Page
To remove a white bar above the header or below the footer, you may need to override the theme's background and spacing. This often involves the .site-footer and html elements.
.site-footer {
border-top: none;
}
html {
background: #303030 !important; /* Change to match your site's background color */
}
5. Adjust Space for a Hidden Sidebar
If you have disabled your sidebar but the content area is not expanding to full width, use this media query to override the default container width.
@media screen and (min-width: 48em) {
.page-one-column .panel-content .wrap {
max-width: none !important;
}
}
Important Considerations and Troubleshooting Tips
- Use !important Sparingly: The
!importantrule is powerful and can override other styles, but it should be used as a last resort to avoid future styling conflicts. - Browser Developer Tools are Your Friend: To find the exact CSS class causing your specific spacing issue, right-click on the element in your browser and select "Inspect." This will show you the HTML structure and the CSS rules applied to it.
- Page Builder Conflicts: Many threads mentioned using page builders like Elementor. Often, excessive space is caused by the page builder's own containers and settings. If you use a page builder, check its settings for padding and margin options first, as their styles will usually override theme CSS.
- Child Theme: For permanent changes, it is highly recommended to add custom CSS to a child theme rather than directly editing the parent theme's files. This prevents your changes from being overwritten during theme updates.
By using these targeted CSS solutions, you can successfully remove unwanted white space and achieve the custom layout you want for your Twenty Seventeen theme.
Related Support Threads Support
-
Remove spacing between sections and footerhttps://wordpress.org/support/topic/remove-spacing-between-sections-and-footer/
-
eliminate blank space below homepagehttps://wordpress.org/support/topic/eliminate-blank-space-below-homepage/
-
Reduce space between postshttps://wordpress.org/support/topic/reduce-space-between-posts-2/
-
Remove White Space Between Menu Bar and Headerhttps://wordpress.org/support/topic/remove-white-space-between-menu-bar-and-header/
-
Issues about Tagline, site title and white space above sliderhttps://wordpress.org/support/topic/issues-about-tagline-site-title-and-white-space-above-slider/
-
Awkward Block Spacinghttps://wordpress.org/support/topic/awkward-block-spacing/
-
Remove padding above menu bar and below footer?https://wordpress.org/support/topic/remove-padding-above-menu-bar-and-below-footer/
-
White Bar below the contenthttps://wordpress.org/support/topic/white-bar-below-the-content/
-
Remove White Space Between Site Identity and Hero Imagehttps://wordpress.org/support/topic/remove-white-space-between-site-identity-and-hero-image/
-
Unwanted White Space on the right of Content onlyhttps://wordpress.org/support/topic/unwanted-white-space-on-the-right-of-content-only/
-
remove empty space gap btween nav bar and article -WP2017 themehttps://wordpress.org/support/topic/remove-empty-space-gap-btween-nav-bar-and-article-wp2017-theme/
-
White Space Before Header and After Footer Twenty Seventeenhttps://wordpress.org/support/topic/white-space-before-header-and-after-footer-twenty-seventeen/
-
Gap btwn Header and menuhttps://wordpress.org/support/topic/gap-btwn-header-and-menu/
-
How to remove empty space between description and navigation barhttps://wordpress.org/support/topic/how-to-remove-empty-space-between-description-and-navigation-bar/
-
Reduce Padding above Page Titlehttps://wordpress.org/support/topic/reduce-padding-above-page-title/
-
Meta Slider unwanted white bar below sliderhttps://wordpress.org/support/topic/meta-slider-unwanted-white-bar-below-slider/
-
White space on post pageshttps://wordpress.org/support/topic/white-space-on-post-pages/
-
Removing White Space between Menu & Footer on Home Pagehttps://wordpress.org/support/topic/removing-white-space-between-menu-footer-on-home-page/
-
Front page gap between Menu bar and next sectionhttps://wordpress.org/support/topic/front-page-gap-between-menu-bar-and-next-section/
-
Removing White Space Between Header and Menu when viewing on desktophttps://wordpress.org/support/topic/removing-white-space-between-header-and-menu-when-viewing-on-desktop/
-
Remove space between title of page and contenthttps://wordpress.org/support/topic/remove-space-between-title-of-page-and-content/
-
Reduce the space between lines?https://wordpress.org/support/topic/reduce-the-space-between-lines-2/
-
Hide/Remove Site Identity Spacinghttps://wordpress.org/support/topic/hide-remove-site-identity-spacing/
-
White Space at top of Pagehttps://wordpress.org/support/topic/white-space-at-top-of-page-5/
-
Twenty Seventeen Frontpage Spacehttps://wordpress.org/support/topic/twenty-seventeen-frontpage-space/
-
How to get rid of white margins?https://wordpress.org/support/topic/how-to-get-rid-of-white-margins/
-
Decrease Paddinghttps://wordpress.org/support/topic/decrease-padding-2/
-
Remove extra white space between page title and page content on Twenty Seventeenhttps://wordpress.org/support/topic/remove-extra-white-space-between-page-title-and-page-content-on-twenty-seventeen/
-
Remove Extra Space between Blog Postshttps://wordpress.org/support/topic/remove-extra-space-between-blog-posts/
-
Remove White Spacehttps://wordpress.org/support/topic/remove-white-space-18/