span / img help..

Associate
Joined
16 Jan 2004
Posts
945
Location
Northampton, UK
I am trying to get 2 images to line up next to each other soas to appear as one image, with no space in the middle.

Here is the html I am using, but it leaves a gap between the images.

Code:
<span style="white-space:nowrap;">
<img src="http://www.ohlookaforum.com/uploads/netleft.jpg" width="425" height="86" alt="" />
<img src="http://www.ohlookaforum.com/uploads/netright.jpg" width="425" height="86" alt="" />
</span>

An example can be seen here - http://www.ohlookaforum.com/uploads/net.html

Can anyone help?

Thanks
Chez
 
Use DIV, not SPAN, since SPAN is an inline element and images belong in block territory.

Also make sure all PADDING and MARGIN attributes are set to zero.
 
Give this a try.

Code:
<div id="header">
  <img width="425" height="86" alt="" src="http://www.ohlookaforum.com/uploads/netleft.jpg"/>
  <img width="425" height="86" alt="" src="http://www.ohlookaforum.com/uploads/netright.jpg"/>
</div>

and in your css sheet, add this.
Code:
#header { overflow: hidden;}
#header img { float: left;}
 
Thanks for the help guys..

I don't think I can mess with header information.. the image will be being used as an advert ona phpBB forum, which already has headers etc on.

Sorry if I sound like a noob.. I kinda am when itcomes to html lol
 
All you need to do is put the images on the same line of code with no space inbetween the image tags that should get rid of the space:

i.e.
<img src.... /><img src... />
 
All you need to do is put the images on the same line of code with no space inbetween the image tags that should get rid of the space:

i.e.
<img src.... /><img src... />

Spot on. Another way is to have them in table cells. (Yuch) (No point for two images, of course).
 
Back
Top Bottom