Hi guys,
I got a question if it is possible to force several images in a horizontal row without linebreak.
I got a div in which there is a table named #scroll in this div I want to load several images with different sizes that should all be ordered next to each other in a horizontal row. The problem is, that the div is only 650px wide. If the space is exceeded, I want the div to display a horizontal scrollbar to explore the images that did not fit in on the right.
With the following CSS I achieved the images to display next to each other:
#scroll { width:650;}
#scroll img {
float: left;
page-break-before: right;
line-height:300px;
display: inline;
margin: 0px;
padding: 0px;
letter-spacing: -3em;
white-space: nowrap;
border: 0 none;
}
HTML
<DIV id=Layer1 style="Z-INDEX: 1; OVERFLOW-x: scroll; overflow-y: hidden; WIDTH: 650px; HEIGHT: 120px">
<table border="1" cellpadding="0" cellspacing="0" id="scroll">
<tr>
<td align="left" valign="bottom" bgcolor="#FF0000">
<img src="../img1.gif" width="140" height="79">
<img src="../img2.gif" width="200" height="200">
<img src="../img3.gif" width="200" height="200">
<img src="../img4.gif" width="185" height="100">
<img src="../img5.gif" width="200" height="200">
</td>
</tr>
</table>
</div>
My problem is now, that the last two images get line-breaked into the next line, below the other images instead of staying to the right of them because the space is limited to 650px.
Can anyone please help me find out where the problem lies? I was searching around the web to find a solution, but there was none with pure css. I know that one can achieve this with a table with X columns and loading each image in a single column. My problem is, that the amount of images varies on each page, so I cant predict the amount of colums I have to prepare, if there are too little I can’t put in further images if there are too many, I scroll spare space.
The whole thing is intended to work in a CMS and the user shouldn’t be forced to learn HTML or CSS in order to display the images on his site.
Hope someone can help.
Thanks in advance
smik