Quick CSS for WordPress Images (Updated)

CSS Web Development WordPress

A 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 custom CSS would not work. Here is some CSS that will work with and without image captions:

.alignright, .aligncenter, .alignleft {padding:4px;background:#ecece2;border:1px solid #c7c7bb;}
.alignright {float:right;margin-left:5px;}
.alignleft, .alignnone {float:left;margin-right:5px;}
.aligncenter {display: block;margin-left: auto;margin-right: auto;}

The difference? I used img.align.. which worked if you did not use captions, but if you use caption, there is an outer div class called align… The more generic CSS posted here takes care of both issues.

Leave a Reply

Your email address will not be published.
*
*

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Web Development WordPress

Show One Post/Page in WordPress

If you want to have a content area somewhere on your site that shows content from a post or page – and you want to do this with using the simplest of code (no loop, no query_posts, etc), check out the function get_post. The get_post function allows you to simply get one post’s title, content, […]

CSS HOWTOs HTML/XTML Javascript Web Development

jQuery + CSS + XHTML = Jappler Menus v2

Previously – I introduced a nice way to create drop down menus using HTML (lists), Javascript (drop down), and CSS (styling of menu). I put all of this together and called it: Jappler Menus. (See previous post about Jappler Menus). Since writing that post – I have found a better, faster, cleaner way to work […]