How to make text not under image

Discussion in 'CSS' started by blue8sky, Jun 23, 2008.

  1. #1
    Hello.

    I have some text and the image in the [div]-tag. How to make the image floating right and the text floating left having the text neither under nor above the image(when the height of the text-block is more than the image's)? Ofcourse I can place the image and the text into [div]-tags each and set a particular width for each of those [div]'s, but It seems there is a better way ))

    Sorry for bad english
     
    blue8sky, Jun 23, 2008 IP
  2. iamben

    iamben Active Member

    Messages:
    116
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    73
    #2
    You could try:

    <img src="image/imagename.jpg" alt="imagename" style="float: left; padding: 0 10px 10px 0;" />

    That will float the image to the left and leave 10 pixels padding to the right and underneath the image so the text isn't totally flush with it.
     
    iamben, Jun 23, 2008 IP
  3. blue8sky

    blue8sky Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanx.
    Sorry )
    I want to have the image floating right and the text on the left. I have edited my first post just now )
     
    blue8sky, Jun 23, 2008 IP
  4. iamben

    iamben Active Member

    Messages:
    116
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    73
    #4
    <img src="image/imagename.jpg" alt="imagename" style="float: right; padding: 0 0 10px 10px;" />

    Just change it around a bit.
     
    iamben, Jun 23, 2008 IP
  5. tarun1979

    tarun1979 Peon

    Messages:
    198
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #5
    This one is good to give a try
     
    tarun1979, Jun 24, 2008 IP