Wrapping images in a div
I am using the following CSS to display images side by side:
#gallery {
background-color: #444;
padding: 10px;
width: 520px;
}
#gallery ul { list-style: none; }
#gallery ul li { display: inline; }
#gallery ul img {
border: 5px solid #3e3e3e;
border-width: 5px 5px 20px;
}
#gallery ul a:hover img {
border: 5px solid #fff;
border-width: 5px 5px 20px;
color: #fff;
}
#gallery ul a:hover { color: #fff; }
html code for above css:
<div id="gallery">
<ul>
<li>
<a href="photos/image1.jpg" title="">
<img src="photos/thumb_image1.jpg"/>
</a>
</li>
<li>
<a href="photos/image2.jpg" title="">
<img src="photos/thumb_image2.jpg">
</a>
</li>
</div>
Everything works fine, but there may be cases where I will display 20 to 30 images, which makes the page very long. Is there a way to add all of this to something so that the whole page doesn't get big and a scrollbar is added around the container containing all the images?
+2
source to share