Welcome to WebmasterWorld Guest from 54.204.211.128

Forum Moderators: incrediBILL

Message Too Old, No Replies

How can I make an Entire List Item Clickable ?

     
8:17 am on Jun 25, 2012 (gmt 0)

New User from US 

5+ Year Member

joined:Aug 6, 2011
posts:7
votes: 0


How can I make an Entire List Item Clickable ?
8:31 am on June 25, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


<li><a href="/path/file" title="pop up title">anchor text</a></li>
4:19 pm on June 25, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
posts:7999
votes: 0


Right, don't jump through hoops to make an unnatural object a link. You can, but the anchor is the natural element for this.

Whatever styles you have on <li> to render its display, apply those to the anchor instead. Hint: anchors are inline by default, you might have to set display:block.
4:27 pm on June 25, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


It's quite natural for each list item of a list to be a separate link. I can think of several scenarios beyond the standard navbar code.
3:44 pm on June 26, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
posts:7999
votes: 0


I mean the anchor is the natural element for a hyperlink, not the list item itself. You'd have to use Javascript to make the list item "clickable" without an anchor, which makes it Javascript dependent, blah blah blah . . . :-)
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members