Post Reply 
 
Thread Rating:
  • 9 Votes - 2.67 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Two images on one line?
07-06-2009, 11:20 PM
Post: #1
Two images on one line?
I have this problem where I have two different images. And I want both images one on one side and the other on the other side.

I've been doing "float: left" and "float: right" for the other, but it's not working very well, float:right one will go all the way to the right, it won't be contained inside the div and float:left will go all the way to the left, it won't stay near the center.

I tried doing "inline" display, but that just doesn't work, only "block" works, which puts both images on their own line.

I tried absolute positioning but then IE for some reason screws everything up because it doesn't understand CSS at all.

What do I do?

[Image: adminexecuterh8.png]
[Image: ABGr7.gif]
☤ ☢ Software Engineer - Director of Inferno ☢ ☤
Visit this user's website Find all posts by this user
Quote this message in a reply
07-06-2009, 11:36 PM
Post: #2
RE: Two images on one line?
float them both left and you will get them side by side.... if you want space between them give the left one margin-right or the right one margin-left..... otherwise use a table (ewww)

-Karl Tiedt
Find all posts by this user
Quote this message in a reply
07-07-2009, 05:44 PM
Post: #3
RE: Two images on one line?
I'll give that a try.

[Image: adminexecuterh8.png]
[Image: ABGr7.gif]
☤ ☢ Software Engineer - Director of Inferno ☢ ☤
Visit this user's website Find all posts by this user
Quote this message in a reply
08-05-2009, 02:13 PM
Post: #4
RE: Two images on one line?
Code:
<div style="width:250px; float:left; margin-right:20px;">image 1</div>
<div style="width:250px; float:left;">image 2</div>
Visit this user's website Find all posts by this user
Quote this message in a reply
08-05-2009, 02:44 PM
Post: #5
RE: Two images on one line?
excessive, no need for the divs at all.... just float the image tags

-Karl Tiedt
Find all posts by this user
Quote this message in a reply
08-05-2009, 02:50 PM
Post: #6
RE: Two images on one line?
is that compliant with the major browsers or does IE fart all over it?
Visit this user's website Find all posts by this user
Quote this message in a reply
08-06-2009, 08:29 AM
Post: #7
RE: Two images on one line?
Sounds like you got it fixed, but for others reading:

You need to clear the divs, as we discussed. That is the main reason IE creates problems is people not clearing elements.
<img src="leftimage.jpg" alt="Left Image" style="float:left;" />
<img src="rightimage.jpg" alt="Right Image" style="float:right;" />
<div style="clear:both"></div>
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)