views:

153

answers:

3

By default, only the text of links is clickable in IE 6. I’d like to make the entire area inside the link (i.e. including padding) clickable as well.

I also need this area to be transparent, as the link covers half of a photo. Adding a background color makes the padding area clickable, but defeats the object, as the link is hidden.

I could have sworn there was a way to do this.

+1  A: 

I remember having come across the same problem but my recollection is hazy about the proper workaround (and if there even was one).

Can you try giving the link a background-color: transparent or a transparent background image? That might work.

If nothing else helps, give the surrounding element a Javascript onclick attribute, and cursor: pointer to simulate link functionality at least for those with JavaScript.

Pekka
Aha: the transparent background image works, even when I hide the text with a large negative `text-indent` value. Good call.
Paul D. Waite
+2  A: 

display: inline-block; usually works for me.

Kobi
`display: inline-block;` works for inline elements only in IE6, so you're a bit lucky there :]
Harmen
Didn't know that, I only use it to style links. So, we're lucky two IE6 bugs complement each other?
Kobi
+2  A: 

display: inline-block is the correct answer, as Kobi says. There is no div or transparent div behind it, just the link element. When the inline-block attribute is applied to it, any padding (and I think line-height) becomes as if it were part of the link.

Tom