pictures

Quick CSS for WordPress Images

hr
hr

If you install WordPress and use the media uploader to manage your images in your posts - you can easily style your images quickly by adding the following code to your theme's stylesheet.

CSS:
img.alignright, img.aligncenter, img.alignleft {padding:4px;background:#efefef;border-color: #aaa #ccc #ddd #bbb;border-style: solid;border-width: 1px;}
img.alignright {float:right;margin-left:5px;}
img.alignleft, img.alignnone {float:left;margin-right:5px;}
img.aligncenter {display: block;margin-left: auto;margin-right: auto;}

This code will set up your images to float appropriately, as well as give a nice border as seen below.

Christmas in DC

Note* This information is now updated: Updated CSS

hr

Comments, Pingbacks and Tracebacks

(Comment icons use gravatars. Sign up for a gravatar so you can be cool too.)

One Response to “Quick CSS for WordPress Images”

  1. [...] week or so ago, I posted some information on how to quickly style your WordPress images. After recently updating my company’s web site (SDAC Inc. - I noticed if you used captions, my [...]


hr

Leave a Reply


search

subscription information

Blog RSS

Comments RSS



Powered by FeedBlitz

blog categories

blog tags

most popular posts


blog archive

standards

Get Firefox!
XHTML
CSS