Turn a containing DIV into a LINK
Posted on Thursday, December 01, 2011
Build your panel using normal CSS techniques and valid HTML.
Somewhere in there put a link that you want to be the default link if the user clicks on the panel (you can have other links too).
Inside that link, put an empty span tag (<span></span>, not <span />)
Give the panel position: relative;
Apply the following CSS to the empty span:
{
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: 1
}
It will now cover the panel, and as its inside an <a> tag, it's a clickable link.
Give any other links inside the panel position:relative; and a suitable z-index (>1) to bring them in front of the default span link.
Category: