View Full Version : Align 2 images on 1 line?
Cheeseboy
04-17-2006, 06:46 PM
Hi, i want to have 2 images on one line like this: (!! !!) could some one please post the code and inside the code have a image like coolimage.jpg or something. I dont think it can be doen in html.
Thanks:thumbsup:
bustamelon
04-17-2006, 07:14 PM
In theory it should work that way by design.
<img> if I recall correctly is an inline element, meaning two img tags side by side will be displayed side by side as long as there is enough width in the containing element to fit them.
This should work:
<img src="coolimage.jpg" alt="Cool Image" /><img src="coolimage.jpg" alt="Cool Image" />
Cheeseboy
04-17-2006, 07:22 PM
Ya, but i want one on the left and one on the right on the same line.
bustamelon
04-17-2006, 07:31 PM
Ya, but i want one on the left and one on the right on the same line.
Why didn't you say so?
Try this:
<span style="text-align: left"><img src="coolimage.jpg" alt="Cool Image" /></span>
<span style="text-align: right"><img src="coolimage.jpg" alt="Cool Image" /></span>
If that doesn't do it, you can of course always do:
<img src="coolimage.jpg" alt="Cool Image" align="left" />
<img src="coolimage.jpg" alt="Cool Image" align="right" />
Cheeseboy
04-17-2006, 07:55 PM
great that worked:thumbsup: , now i want them to be on top of each other like this:
(!! !!)
(!! !!)
(!! !!)
P.s i tried a <br> didnt work.
bustamelon
04-17-2006, 08:19 PM
put each pair inside a <div> element.
<div>
<img src="coolimage.jpg" alt="Cool Image" align="left" />
<img src="coolimage.jpg" alt="Cool Image" align="right" />
</div>
<div>
<img src="coolimage.jpg" alt="Cool Image" align="left" />
<img src="coolimage.jpg" alt="Cool Image" align="right" />
</div>
or a <p>, or whatever.... I don't know why <br> wouldn't work.
Cheeseboy
04-17-2006, 08:38 PM
did does work I put it beside it now I did:
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
I have alot of <br /> Is there a better way than this to make them?
thanks
bustamelon
04-17-2006, 09:11 PM
did does work I put it beside it now I did:
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
I have alot of <br /> Is there a better way than this to make them?
thanks
Sorry, I don't follow.
felgall
04-17-2006, 10:00 PM
Instead of a lot of <br> you should be setting margin sizes.
Also align is deprecated you should be using the stylesheet commands float:left and float:right instead.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.