July 28, 2008
1:34 am

If you’ve not upgraded your blog to WordPress 2.6 yet, do it now, because it has got cool new features and WordPress 2.5.x wouldn’t be supported further.

One among the many new features that WordPress 2.6, is the text editor let you float images within the post content so that the text wraps around the images properly. You can align the images to be “left”, “right” or “centered”. When you use the text editor to align the images, WordPress adds class=”alignleft”, class=”alignright” or class=”aligncentered” to the ‘img’ tags or its surrouding ‘div’ element, when you choose left, right or center alignment for your images.

The post looks aligned to the left, right or centered within the WordPress admin area, but when you see the post on your site, it may not look properly aligned. It is because the theme that you are using, may not be aware of those classes added by WordPress.

You can easily overcome this porblem by adding the following code to your style.css:

img.alignleft, div.alignleft {
float:left;
margin:0 0.5em 0.5em 0;
}
img.alignright, div.alignright {
float:right;
margin:0 0 0.5em 0.5em;
}
img.aligncentered, div.aligncentered {
text-align:center;
margin:0 auto;
}

Source:→ WP Layer

Loading

Contextual Related Posts:

2 Responses | RSS comments on this post | Leave a comment»

  1. 1
    { K } says#2 | December 15th, 2008 at 11:59 pm

    thank you so much for this info a very great help!!! :)

  1. Pingback from
    1
    Dicas Wordpress - Alinhamento de Imagens em Posts Wordpress 2.6 - Wordpressbr.com says:July 28th, 2008 at 1:55 pm

    [...] WordPress 2.6 Floating Images within post [...]

Leave a Response

Comment Preview
« Delegation Model in Hyper-V – Part 2Microsoft Virtual Earth ASP.NET Control »
Feed Icon

Subscribe via RSS or email: