Be sure to add these CSS declarations to your WordPress 2.5/2.6 stylesheets

| August 20, 2008 | Leave a Comment

Versions of WordPress 2.5 and 2.6 have added arbitrary new CSS classes for styling uploaded images (WP 2.5) and their captions (WP 2.6). The WordPress Codex has a page that provides CSS declarations you can add to your custom theme if you’re not too familiar with tweaking your stylesheets.


.aligncenter,
div.aligncenter {
   display: block;
   margin-left: auto;
   margin-right: auto;
}

.alignleft {
   float: left;
}

.alignright {
   float: right;
}

.wp-caption {
   border: 1px solid #ddd;
   text-align: center;
   background-color: #f3f3f3;
   padding-top: 4px;
   margin: 10px;
   /* optional rounded corners for browsers that support it */
   -moz-border-radius: 3px;
   -khtml-border-radius: 3px;
   -webkit-border-radius: 3px;
   border-radius: 3px;
}

.wp-caption img {
   margin: 0;
   padding: 0;
   border: 0 none;
}

.wp-caption p.wp-caption-text {
   font-size: 11px;
   line-height: 17px;
   padding: 0 4px 5px;
   margin: 0;
}

Also check out the links posted for more help on CSS, HTML, and WordPress blog design in general.

(Via)

Related Posts

Tags: , , , , , , ,

1 Comment

  1. Leonaut.com Said,

    Be sure to add these CSS declarations to your WordPress 2.5/2.6 stylesheets…

    Versions of WordPress 2.5 and 2.6 have added arbitrary new CSS classes for styling uploaded images (WP 2.5) and their captions (WP 2.6). The WordPress Codex has a page that provides CSS declarations you can add to your custom theme if you’re not too …

RSS feed for comments on this post · TrackBack URI

Leave a Reply