Brad Bansner
asked on
can I make an entire DIV element clickable with a <a> link?
Is there some way to do something similar to this:
<a href="#"><div class="clickbox">content here</div></a>
...and have the entire DIV be clickable? So not just the text "content here" but the whole box? Like if I set a width: 300px height 300px anywhere within that would link? Thank you!
<a href="#"><div class="clickbox">content here</div></a>
...and have the entire DIV be clickable? So not just the text "content here" but the whole box? Like if I set a width: 300px height 300px anywhere within that would link? Thank you!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Try this - http://www.smileycat.com/miaow/archives/000230.php
ASKER
Hmm, I must be doing something wrong on this page, then:
http://www.dbiservices.com/new/deangelobrothersinc/alenza1.asp
#caption1 {
border: 1px solid #000000;
position: absolute;
width: 200px;
height: 20px;
top: 357px;
left: 282px;
padding: 80px 0px 0px 0px;
}
<a href="http://www.dbiservices.com"><div id="caption1"><p class="nobr">Click for product labels and MSDS</p></div></a>
Any idea why mine aren't clickable at all?
http://www.dbiservices.com/new/deangelobrothersinc/alenza1.asp
#caption1 {
border: 1px solid #000000;
position: absolute;
width: 200px;
height: 20px;
top: 357px;
left: 282px;
padding: 80px 0px 0px 0px;
}
<a href="http://www.dbiservices.com"><div id="caption1"><p class="nobr">Click for product labels and MSDS</p></div></a>
Any idea why mine aren't clickable at all?
Try with an onclick
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ah, I found the problem. They were positioned absolutely. I changed z-index:2 and now they work. Thanks for the input!