• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar

WP SITES

2296

Original Genesis Tutorials & 5000+ Code

Snippets

  • Subscribe
  • Full Access
  • Videos
  • Log in
  • Twitter
  • Facebook
  • LinkedIn
  • Email
  • More
  • Reddit
  • Tumblr
  • Google
  • Print
  • Pinterest
  • Telegram
  • Pocket
  • Skype
  • WhatsApp

Center HTML Content In Sidebar Text Widget

This tutorial provides a simple solution to center any HTML content you add to any text widget in any sidebar widget area.

Here’s the forum question this post answers:

I just added a “Follow Me on BlogLovin’ ” Widget to my sidebar. How do I get this centered?

Here’s an example of a HTML follow button added to a text widget in the primary sidebar:

not centered

And here’s the same HTML button now aligned center after adding some CSS code to the style sheet:

center text widget

And here’s the CSS with 3 options to choose from:

#text-8 {
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

In the above example, i’ve used the text widget I.D which you can find using Firebug.

You could also replace #text-8 with one of these:

.widget_text or .textwidget

The only problem is, this will effect all text widgets in your sidebar so you would only use these 2 classes if you are only using 1 text widget in your sidebar, otherwise use the I.D.

Related Posts

  • Style Widgets Individually – Beginners Guide
Subscribe for new Genesis Tutorials

Primary Sidebar

Brad Dalton Specializes In StudioPress child theme customization & code modification. Access all code

Featured Downloads

  • Responsive Image After Header On Single Pages 67126
  • Rotate Widget Background Images In Genesis 67200
  • Template To Display All Posts by Each Category In Genesis 67050
WordPress Speed Test
  • Membership
    • Account Subscription Details
  • Tagged by Theme
  • Blog
  • T.O.C
    • Membership F.A.Q’s
  • RSS
  • Contact
  • Newsletter ( Twice Weekly )

Usage Policy · Tools & Resources


Images, code, and content on this website are property of wpsites.net and are protected by copyright law.
WP Sites does not grant permission for any repurposing, republication, or redistribution.
"Disclosure: Some of the links in some posts are "affiliate links."
This means if you click on the link and purchase the item, I will receive an affiliate commission.
loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.