Jul
16
2010

WordPress Image Padding

So I just ran into a bit of an “issue” with WordPress and the way it handles images by default.  This is on a per-theme basis, but for whatever reason my theme didn’t already have image padding, so the text went right up to the side of the image.  There is a simple fix!

First, click on Appearance (from the Dashboard), and then click on Editor.  Scroll to the bottom of that stylesheet and add:

/* ——————————–
PICTURES ALIGN
———————————–*/
.alignright { padding: 4px; margin: 0 0 2px 7px; float: right; }
.alignleft { padding: 4px; margin: 0 7px 2px 0; float: left; }
Then click Update File.  Now, when you add an image, if you click one of the alignment options, it should work!  Note: it doesn’t appear to work in the “Add New Post” window…but works when the post gets published!

About the Author: Chris Bellman

Sophomore ECE major at The Ohio State University. Technology enthusiast. Runs own IT business in Cincinnati.