Link to home
Start Free TrialLog in
Avatar of Brad Bansner
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!
ASKER CERTIFIED SOLUTION
Avatar of Roman Gherman
Roman Gherman
Flag of Moldova, Republic of image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Randy Downs
Avatar of Brad Bansner
Brad Bansner

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?
Try with an onclick
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ah, I found the problem. They were positioned absolutely. I changed z-index:2 and now they work. Thanks for the input!