views:

198

answers:

2

I have an anchor tag with some simple CSS:

div {
  background-color: gray; /* for debugging */
}

div a {
  display: block;
  padding: 6px 4px 6px 7px;
  background-color: red; /* for debugging */
}

In Firefox, the anchor (in red) is clickable even outside of the text because of it being display: block with some padding. In IE7, when I hover over the red area that is not text, the anchor is no longer a link there.

A: 

Try adding zoom: 1 to the element. This gives the element hasLayout, which is not only the source of 60% of all IE bugs (according to a survey I made up to make this point), but also tends to plague block-level anchors.

cpharmston
Thanks, I added `zoom: 1;` to the `div a` however now its appearing like its no longer block but inline. Any ideas?
Mark Ursino
A: 

Somehow a combination of zoom: 1; position: relative; seemed to have worked for me. So buggy!

Chris F.