I have several div elements which contain images, every image's height is set to 100%, width is calculated. Height works fine, but the parent div has image's real width, wich is larger then computed width. That makes gaps between the images. How can I make div to have the width of the image as it is displayed (not the width of the file itself)? Could that be solved with html/CSS only?
HTML:
<table>
<tr>
<td align-"center" valign="middle" style="background:#000;">
<div class="scrollable">
<div class="items">
<div>
<img style="height:100%;" src="001.png">
</div>
</div>
</div>
</td>
</tr>
</table>
CSS:
table {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
border-collapse: collapse;
border: 0;
}
td {
width: 100%;
height: 100%;
padding: 0;
border: 0;
}
.scrollable {
position: relative;
overflow: hidden;
width: 100%;
height: 100%;
max-height: 1000px;
}
.scrollable .items {
width: 25000px;
height: 100%;
position: absolute;
}
.items {float: center;}
.items div {
float: left;
width: auto;
padding: 0;
margin: 0;
}
Any ideas? Tnanks!