Log In · Register

 
Placing image to the left of a blog post
bigtrey90
post May 13 2009, 10:00 AM
Post #1


talent on another level
*****

Group: Member
Posts: 746
Joined: Oct 2006
Member No: 475,735



I am trying to achieve this image placement in Wordpress on my post as shown on this website:

http://giant.blackplanet.com/

How can I do this?
 
 
Start new topic
Replies
fixtatik
post May 13 2009, 12:01 PM
Post #2


Senior Member
******

Group: Member
Posts: 1,237
Joined: May 2008
Member No: 648,123



oh, the power of floating.
CODE
.alignleft { float:left; margin:0 0 0 20px; }
.alignright { float:right; }
.clear { display:block; height:0; visibility:hidden; }

CODE
<div>
  <img src="URL" class="alignleft" alt="" />
  <div class="alignright">
    text, text, text.
  </div>
  <div class="clear"></div>
</div>

the extra class, .clear, is really optional. it depends on how you have the container div displayed. if it's being displayed as a block element (default display), and not a table (which doesn't even work in IE), then when you float different elements inside the div, it won't retain its height. there are many other ways to do it, but this is usually one of the easiest, as you can put whatever you want in the div that's aligned to the right without any problems.
 

Posts in this topic


Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: