Jump to content

Displaying Images


ajmsake

Recommended Posts

I have a list of images to display on the same line but the following places a space between the images

<img src="image1.gif"><img src="image2.gif"><img src="image3.gif"><img src="image4.gif">

however if I do this... the space is removed but the code is hard to read

<img src="image1.gif"><img src="image2.gif"><img src="image3.gif"><img src="image4.gif">

using the first code sample how can I get rid of the space between each image and keep it readable in the editor?Thanks!

Link to comment
Share on other sites

You can make the tags go more then one line, but so that there is no space between the tags.<img src="image1.gif"><img src="image2.gif"><img src="image3.gif"><img src="image4.gif">It's kind of cheesy, but I guess it works. You might also be able to use some CSS to hide the whitespace, I'm not sure about that.

Link to comment
Share on other sites

Well you could use font-size:0px; as in

<div style="font-size:0px; ">	<img src="image1.gif">	<img src="image2.gif">	<img src="image3.gif">	<img src="image4.gif"></div>

for the parent tag but that would make any text in the container element unreadable. The problem is that certain browsers interpret the newline character as a space, and CSS can't really fiddle with content.

Link to comment
Share on other sites

:) He wants to remove the space between the images, not insert a new line. I was just saying that in IE a newline character is interpreted as a space, instead of as nothing, and so put a gap between the two images.
Link to comment
Share on other sites

:) He wants to remove the space between the images, not insert a new line. I was just saying that in IE a newline character is interpreted as a space, instead of as nothing, and so put a gap between the two images.
You can remove the spaces in IE by using tables.Like so.
<table border="0" cellpadding="0" cellspacing="0" width="400"> <tr valign="top">  <td align="left" width="100"><img src="image1.gif"></td>  <td align="left" width="100"><img src="image2.gif"></td>  <td align="left" width="100"><img src="image3.gif"></td>  <td align="left" width="100"><img src="image4.gif"></td> </tr></table>

It's alittle more coding but it works.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...