E
Ed
Just starting out trying to learn XHTML/CSS and, to this end, I have a
project to create a thumbnail gallery in which I can click on any image
to display the full size picture. And I want to do this without using
frames or tables. I've come across two approaches to this.
The first is to put each thumbnail in its own div (all with the same
class) and then use CSS to float these left and to add style:
<div class="thumbnail"><a href="page5.htm"><img src="imgp0416_tmbn.jpg"
alt="pic" height="125" />Image 416</a></div>
<div class="thumbnail"><a href="page3.htm"><img src="imgp0382_tmbn.jpg"
alt="pic" height="125" />Image 382</a></div>
<div class="thumbnail"><a href="page4.htm"><img src="imgp0383_tmbn.jpg"
alt="pic" height="125" />Image 383</a></div>
In the second approach, each thumbnail is placed in an unordered list
like so:
<div class="thumbs">
<ul>
<li><a href="page5.htm"><img src="imgp0416_tmbn.jpg" height="125"
alt="[pic]" />Image 416</a></li>
<li><a href="page3.htm"><img src="imgp0382_tmbn.jpg" height="125"
alt="[pic]" />Image 382</a></li>
<li><a href="page4.htm"><img src="imgp0383_tmbn.jpg" height="125"
alt="[pic]" />Image 383</a></li>
</ul>
</div>
Again, CSS is used to float the images to the left and apply style.
Both approaches give me the same result. But is one method considered
more strict? Are there any inherent advantages/disadvantages to one
approach over the other?
I would appreciate any advice based on the experience of this group,
though I suspect that this is a project that has been done umpteen times
by people here so may not be of any interest to you But, for me, it is
new, and I'd like to get off to a good start.
Thanks,
Ed
project to create a thumbnail gallery in which I can click on any image
to display the full size picture. And I want to do this without using
frames or tables. I've come across two approaches to this.
The first is to put each thumbnail in its own div (all with the same
class) and then use CSS to float these left and to add style:
<div class="thumbnail"><a href="page5.htm"><img src="imgp0416_tmbn.jpg"
alt="pic" height="125" />Image 416</a></div>
<div class="thumbnail"><a href="page3.htm"><img src="imgp0382_tmbn.jpg"
alt="pic" height="125" />Image 382</a></div>
<div class="thumbnail"><a href="page4.htm"><img src="imgp0383_tmbn.jpg"
alt="pic" height="125" />Image 383</a></div>
In the second approach, each thumbnail is placed in an unordered list
like so:
<div class="thumbs">
<ul>
<li><a href="page5.htm"><img src="imgp0416_tmbn.jpg" height="125"
alt="[pic]" />Image 416</a></li>
<li><a href="page3.htm"><img src="imgp0382_tmbn.jpg" height="125"
alt="[pic]" />Image 382</a></li>
<li><a href="page4.htm"><img src="imgp0383_tmbn.jpg" height="125"
alt="[pic]" />Image 383</a></li>
</ul>
</div>
Again, CSS is used to float the images to the left and apply style.
Both approaches give me the same result. But is one method considered
more strict? Are there any inherent advantages/disadvantages to one
approach over the other?
I would appreciate any advice based on the experience of this group,
though I suspect that this is a project that has been done umpteen times
by people here so may not be of any interest to you But, for me, it is
new, and I'd like to get off to a good start.
Thanks,
Ed