Adding links to list items

  ade.h 18:31 11 Sep 2006

This one has me thinking "I should know this!" I am using a CSS-styled list to display thumbnail images, each of which requires a link to the full-size jpeg. The problem is; I don't know where the href tag should be added within, or next to, each li tag in the markup. A Google search has not thrown up a straight answer.

  Red Devil 18:55 11 Sep 2006

Thius is how I do it on the website you've been giving me feedback on:-

<ul id="navlist">
<li><a href="index.htm">Home</a></li>
<li><a href="LatestNews.htm">Latest News</a></li>
<li><a href="Forum.htm">Forum</a></li>
<li><a href="click here" target="_blank">Romney, Hythe & Dymchurch</a></li>
<li><a href="click here" target="_blank">Spa Valley</a></li>
<li><a href="click here" target="_blank">Bluebell Line</a></li>
<li><a href="click here" target="_blank">Sittingbourne & Kemsley Light</a></li>
<li><a href="click here" target="_blank">Severn Valley</a></li>
<li><a href="click here" target="_blank">Talyllyn</a></li>
<li><a href="click here" target="_blank">Great Central</a></li>
<li><a href="click here" target="_blank">Snowdon Mountain</a></li>
<li><a href="click here" target="_blank">Kent & East Sussex</a></li>
<li><a href="click here" target="_blank">West Somerset</a></li>
<li><a href="click here" target="_blank">Lynton & Barnstaple</a></li>
<li><a href="click here" target="_blank">Battlefield Line</a></li>
<li><a href="click here" target="_blank">Barry Island </a></li>
<li><a href="click here" target="_blank">East Somerset</a></li>
<li><a href="click here" target="_blank">Bodmin & Wenford</a></li>
<li><a href="click here" target="_blank">Ravenglass & Eskdale</a></li>
<li><a href="click here" target="_blank">Lakeside & Haverthwaite</a></li>
<li><a href="Policy.htm">Site Policy & Copyright</a></li>
<li><a href="mailto:[email protected]">E-mail The Site</a></li>

Hope it helps you with how you want to do it with your site.

  ade.h 18:58 11 Sep 2006

You've missed my point slightly.

That is a list of links, which is used to create a navigation bar using CSS, as you have done.

I need to add links to a list of thumbnails, which is like this:

<ul id="album2" class="thumbs">
<li><img src="./assets/img08thumb.jpg" width="149" height="99" /></li>
<li><img src="./assets/img12thumb.jpg" width="149" height="99" /></li>
<li><img src="./assets/img11thumb.jpg" width="149" height="99" /></li>
<li><img src="./assets/img14thumb.jpg" width="149" height="99" /></li>

Thanks anyway.

  Red Devil 19:07 11 Sep 2006

But wouldn't it be the same principle? I'm using text whereas you're using images but shouldn't the href definition still be the same?


<ul id="album2" class="thumbs">
<li><a href="your link here"><img src="./assets/img08thumb.jpg" width="149" height="99" /></a></li>


Or am I talking out of an orifice that isn't my mouth? ;)

  ade.h 19:24 11 Sep 2006

Yes, that's how I have been trying to do it and it's exactly how I would expect to do it, but it's not working for me.

  Red Devil 19:27 11 Sep 2006

Is the site up on the net? I could see how it looks for me.

Otherwise I'm all out of ideas as that would be the way I would do it too.

  ade.h 20:12 11 Sep 2006

You and I were both barking up the right tree after all. I viewed the file on another PC, with IE, and it's fine. There's something up with Firefox, I think, because I had a problem with some anchors recently, which weren't working. I gave up on them, but I have just viewed that file on the other PC and it's okay too. Off to re-install Firefox...

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

WPA2 hack: How secure is your Wi-Fi?

Microsoft Surface Book 2 hands-on review – bigger and 5x faster

Best kids apps for iPhone & iPad

Que faire si son iPhone ou iPad est tombé dans de l'eau ?