How to Align two images at extreme opposite ends?

Discussion in 'HTML & Website Design' started by shubhamjain, Nov 23, 2009.

  1. #1
    I have a div. I want two align two images at both ends of div. Any way i can do that?
     
    shubhamjain, Nov 23, 2009 IP
  2. Diputs

    Diputs Greenhorn

    Messages:
    55
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #2
    make 2 more divs (1 around each image) and float them left and right like so:

    <div id="parentContainer">
    
    <div class="floatLeft"><img src="picture.jpg alt="" /></div>
    <div class="floatRight"><img src="picture.jpg alt="" /></div>
    
    <div class="clear"></div>
    
    </div>
    Code (markup):
    then in your css you would do

    
    .floatLeft {float:left;}
    .floatRight {float:right}
    
    .clear {clear:both;}
    
    Code (markup):
    happy coding ! :)
     
    Diputs, Nov 24, 2009 IP
  3. lastfiend

    lastfiend Greenhorn

    Messages:
    50
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #3
    usually using float in css. if it still insist, play with the display along float. like block etc. however, if the previous keep insist your desired position, k.o it with margin. ;)
     
    lastfiend, Nov 24, 2009 IP