How to centre the drop-down archive widget

The drop-down version of the Archive list may have saved space in the sidebar, but if the sidebar is pretty much centre-aligned, then it looks a bit out of place.

The left-aligned archive list

To solve this, we can use some CSS code to move it to the centre as well.

MAKE SURE YOU BACKUP YOUR THEME BEFORE MAKING THIS CHANGE

1. Log into WordPress using an administrator account.

2. Now click on “Editor” in the “Appearance” section of the sidebar.

Click on Editor

3. Next, click on “Stylesheet (style.css)” on the right-hand side of the screen.

Open style.css

4. Search for the “Widget areas” in this file.

Search for the Widget Areas

5. Insert the following code:

.widget_archive {
text-align: center;
}

6. Click on save.  The widget should now be centred:

The centred widget

About Graham Tappenden

Graham Tappenden is a blogger from Germany. He has written code for WordPress themes since 2006 and been creating websites since 1994.
This entry was posted in TwentyTen and tagged , , , . Bookmark the permalink.