Jimmy
Jimmy

Reputation: 12487

Make the entire list area clickable

On my site I have a few links within lists. I was wondering if it is possible to make it so I can click on the entire list area, rather than just where the inner link sits. An example is my "post" link at the top right of the page.

This is the code I'm working with: http://jsfiddle.net/spadez/XgSBf/1/

I tried to put the link outside the list like this but it didn't work:

<a href=#><li>test</li></a>

Upvotes: 3

Views: 813

Answers (4)

Ganesh Bora
Ganesh Bora

Reputation: 1153

Add style="display:block" to anchor tag. adding display block make this area of link click able

Upvotes: 2

heinkasner
heinkasner

Reputation: 425

<li><a style="display:block;" href="some_page.extension">Next</a></li>

Rather try something like above. Include the link within your 'list item' tag, this way you make the entire area clickable.

Upvotes: 1

Sowmya
Sowmya

Reputation: 26969

Add display:block to a tag

a {
    text-decoration: none; display:block
}

DEMO

Upvotes: 2

Gimmy
Gimmy

Reputation: 3911

It's not good coding. try this:

<li><a href="#" style="display: block">test</a></li>

Upvotes: 3

Related Questions