Jump to content

how to display images inline with inside a div with a scroll


Lisa23

Recommended Posts

Hi i am trying to have image with scroll bar i do not want to set the size of div inside because if i set a size the scroll bar will just scroll empty space so i am trying to set size 100% so it sets automatically but with the div with 100% scroll bar doesnt show. help please

<div style="background-color:red; width:300px; height:200px; overflow:scroll; overflow-x: scroll; overflow-y: hidden;">
<div style="width:100%;">
<div class="img">
<a target="_blank" href="klematis_big.htm"><img src="klematis_small.jpg" alt="Klematis" width="110" height="90" /></a>
<div class="desc">Add a description of the image here</div>
</div>
<div class="img">
<a target="_blank" href="klematis2_big.htm"><img src="klematis2_small.jpg" alt="Klematis" width="110" height="90" /></a>
<div class="desc">Add a description of the image here</div>
</div>
<div class="img">
<a target="_blank" href="klematis2_big.htm"><img src="klematis2_small.jpg" alt="Klematis" width="110" height="90" /></a>
<div class="desc">Add a description of the image here</div>
</div>
<div class="img">
<a target="_blank" href="klematis4_big.htm"><img src="klematis4_small.jpg" alt="Klematis" width="110" height="90" /></a>
<div class="desc">Add a description of the image here</div>

</div>
</div>
</div>

Not completely sure what you mean, but take a look at this and see if it's close:

<style type="text/css">
.img
{
border: green solid 1px;
//width: 300px;
float:left;
}
</style>

<body>

<div style="background-color:red; width:300px; height:200px; overflow:scroll; overflow-y: scroll; overflow-y: hidden;">
<div style="width:3000px;">
<div style="width:100%;">
	<div class="img">
	 <a target="_blank" href="klematis_big.htm"><img src="klematis_small.jpg" alt="Klematis" width="110" height="90" /></a>
	 <div class="desc">Add a description of the image here</div>
	</div>

	<div class="img">
	 <a target="_blank" href="klematis2_big.htm"><img src="klematis2_small.jpg" alt="Klematis" width="110" height="90" /></a>
	 <div class="desc">Add a description of the image here</div>
	</div>

	<div class="img">
	 <a target="_blank" href="klematis2_big.htm"><img src="klematis2_small.jpg" alt="Klematis" width="110" height="90" /></a>
	 <div class="desc">Add a description of the image here</div>
	</div>

	<div class="img">
	 <a target="_blank" href="klematis4_big.htm"><img src="klematis4_small.jpg" alt="Klematis" width="110" height="90" /></a>
	 <div class="desc">Add a description of the image here</div>
	</div>
</div>
</div>
</div>

</body>

  • 2 weeks later...

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.