How to Center Elements in the Twenty Seventeen Theme: A Complete Guide
Content
One of the most common questions from users of the Twenty Seventeen theme is how to center various elements on their website. Whether it's the social links menu, the site title, page content, or the main navigation, many users find the default left alignment isn't quite right for their design.
This guide compiles the most effective solutions from the community to help you center elements in your Twenty Seventeen theme.
Why Centering Can Be Challenging
The Twenty Seventeen theme uses a specific CSS structure that controls element alignment. Simply using text-align: center; doesn't always work because many elements have fixed widths, flexbox containers, or other layout constraints that override basic alignment properties.
Common Centering Solutions
1. Centering the Social Links Menu in Footer
To center the social icons in your footer, add this CSS to Appearance → Customize → Additional CSS:
.social-navigation {
width: 100% !important;
text-align: center !important;
}
.social-navigation .menu {
display: inline-block;
float: none;
}2. Centering the Top Navigation Menu
For the main navigation menu, try this CSS approach:
.navigation-top {
text-align: center;
}
.navigation-top .wrap {
max-width: 100%;
display: inline-block;
float: none;
}3. Centering Page/Post Content
To center your main content area when using no sidebar:
.page .entry-header,
.single .entry-header,
.entry-content {
margin-left: auto;
margin-right: auto;
float: none;
text-align: center;
}
4. Centering the Site Title
To center your site title and tagline:
.site-branding {
text-align: center;
margin: 0 auto;
}
.site-title,
.site-description {
text-align: center;
margin: 0 auto;
}Important Notes
Before making these changes:
- Use a Child Theme: Always use a child theme when modifying theme files to preserve your changes during updates.
- Clear Your Cache: After adding CSS, clear your browser cache and any caching plugins to see the changes.
- Test Responsiveness: Check how your changes look on different screen sizes. You may need to add media queries for mobile devices.
These solutions address the most common centering requests for the Twenty Seventeen theme. The exact CSS needed may vary slightly depending on your specific setup and any other customizations you've made.
Related Support Threads Support
-
Vertical-align for content. how to make it workshttps://wordpress.org/support/topic/vertical-align-for-content-how-to-make-it-work/
-
Menu center alignmenthttps://wordpress.org/support/topic/menu-center-alignment-2/
-
Center individual pages within full widthhttps://wordpress.org/support/topic/center-individual-pages-within-full-width/
-
Move site title to align righthttps://wordpress.org/support/topic/move-site-title-to-align-right/
-
Center Contenthttps://wordpress.org/support/topic/center-content-8/
-
All pictures are centered automaticallyhttps://wordpress.org/support/topic/all-pictures-are-centered-automatically/
-
Display site-title in centre of screenhttps://wordpress.org/support/topic/display-site-title-in-centre-of-screen/
-
Social Links Menuhttps://wordpress.org/support/topic/social-links-menu-3/
-
Cart line alignmenthttps://wordpress.org/support/topic/cart-line-alignment/
-
How to centre my texthttps://wordpress.org/support/topic/how-to-centre-my-text/
-
Justify text – Blog and Pagehttps://wordpress.org/support/topic/justify-text-blog-and-page/
-
Help with the social link menuhttps://wordpress.org/support/topic/help-with-the-social-link-menu/
-
How do I get my menu centered?https://wordpress.org/support/topic/how-do-i-get-my-menu-centered/
-
Align pages better – remove white space on the lefthttps://wordpress.org/support/topic/align-pages-better-remove-white-space-on-the-left/
-
How to Align right Yoast SEO breadcrumbshttps://wordpress.org/support/topic/how-to-align-right-yoast-seo-breadcrumbs/
-
How to center the main front page posts content area with no sidebarhttps://wordpress.org/support/topic/how-to-center-the-main-front-page-posts-content-area-with-no-sidebar/
-
Align one line of text in a blog posthttps://wordpress.org/support/topic/align-one-line-of-text-in-a-blog-post/
-
How to change center the height of the site titlehttps://wordpress.org/support/topic/how-to-change-center-the-height-of-the-site-title/
-
centering image captionshttps://wordpress.org/support/topic/centering-image-captions/
-
Site title in two lineshttps://wordpress.org/support/topic/site-title-in-two-lines/
-
How to center the Front Page menuhttps://wordpress.org/support/topic/how-to-center-the-front-page-menu/
-
Centre Blog Index on Home.phphttps://wordpress.org/support/topic/centre-blog-index-on-home-php/
-
centering homepage contenthttps://wordpress.org/support/topic/centering-homepage-content/
-
Center header menu in Rise Themehttps://wordpress.org/support/topic/center-header-menu-in-rise-theme/
-
Centred heading and menu?https://wordpress.org/support/topic/centred-heading-and-menu/
-
Center Page Titleshttps://wordpress.org/support/topic/center-page-titles-3/