How to Wrap Text Around Images in WordPress Themes

By | March 9, 2009

A simple code will help you to use text and images in a splendid way using WordPress. You should alter a CSS file to add the following lines:

img.centered {
display: block;
margin-left: auto;
margin-right: auto;
}

img.alignright {
padding: 4px;
margin: 0 0 2px 7px;
display: inline;
}

img.alignleft {
padding: 4px;
margin: 0 7px 2px 0;
display: inline;
}

.alignright {
float: right;
}

.alignleft {
float: left;
}

Once this is done, your text will be wrapped around images.