Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make the entire list area clickable

Tags:

html

css

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>
like image 873
Jimmy Avatar asked Nov 21 '25 15:11

Jimmy


2 Answers

It's not good coding. try this:

<li><a href="#" style="display: block">test</a></li>
like image 112
Gimmy Avatar answered Nov 24 '25 06:11

Gimmy


Add display:block to a tag

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

DEMO

like image 31
Sowmya Avatar answered Nov 24 '25 05:11

Sowmya



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!