Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Junior Member jazzhands's Avatar
    Join Date
    Sep 2006
    Location
    Cincinnati
    Posts
    3
    Member #
    14017
    Ok, I have encountered this problem a couple times. I have two images that I would like to place in the same div, but at opposite ends.

    I'll set the align on the second image to right, and it seems to drop down a line below the image on the left in the same div. The only way I could make this work was to insert a bunch of type between the two images and change the color of the type to the background of the page.

    The site is located at http://www.wingsmodels.com

    The two images that I am referring to are at the bottom of the page on the left and right respectively.

    I know there is a proper way to align them the way I want them to and I would appreciate it if someone could tell me.

    Thanks!!!!

  2.  

  3. #2
    Senior Member glyakk's Avatar
    Join Date
    Nov 2003
    Location
    USA
    Posts
    1,263
    Member #
    3828
    Liked
    6 times
    Have you looked at using the float property in your CSS instead of using the align attributes in your markup? This is the basic structure.

    HTML Code:
    <div>
      <img class="img1" src="img1.gif" />
      <img class="img2" src="img2.gif" />
    </div>
    And this would be your CSS for the images

    Code:
    .img1 {
      float: left;
    }
    
    .img2 {
      float: right;
    }


  4. #3
    Junior Member jazzhands's Avatar
    Join Date
    Sep 2006
    Location
    Cincinnati
    Posts
    3
    Member #
    14017
    I can't float one image left and one image right if they are both in the same div can I?

  5. #4
    Senior Member glyakk's Avatar
    Join Date
    Nov 2003
    Location
    USA
    Posts
    1,263
    Member #
    3828
    Liked
    6 times
    Absolutly you can. Specify a width and height for the div and float them to opposit sides..


  6. #5
    Junior Member jazzhands's Avatar
    Join Date
    Sep 2006
    Location
    Cincinnati
    Posts
    3
    Member #
    14017
    Thanks for the info. That makes alot of sense, lol. I guess I was thinking about it to hard.

  7. #6
    ljm
    ljm is offline
    Senior Member ljm's Avatar
    Join Date
    Aug 2006
    Location
    Manchester, England
    Posts
    284
    Member #
    13684
    Liked
    1 times
    Does that way work? You need to float the first image to the right, and the second to the left. Since it's back to front, the left float occupies the space the right one leaves behind. The other way, it goes onto a new line.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search tags for this page

div image placement

Click on a term to search for related topics.
All times are GMT -6. The time now is 10:29 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com