Problem with IE when using display:block for links

Posted by Waleed Eissa on Stack Overflow See other posts from Stack Overflow or by Waleed Eissa
Published on 2009-05-19T08:42:15Z Indexed on 2010/04/24 10:43 UTC
Read the original article Hit count: 262

Filed under:
|
|

This is my HTML:

<div id="links">
  <a href="">Link 1</a>
  <a href="">Link 2</a>
  <a href="">Link 3</a>
  <a href="">Link 4</a>
</div>

And these are the CSS styles:

#links {
    position: absolute;
    border: 1px solid #000;
}

#links a {
    display: block;
}

#links a:hover {
    background-color: #CCC;
}

This displays a list of links, the problem is that in IE, I can only click a link by directly clicking the text link, which is not the case with other browsers (where you can click anywhere whether the text link or anywhere else as long as it's in the link block), is there any fix for that (with only CSS, no javascript)?

Please note that I don't want to specify a width for the links or the div.

© Stack Overflow or respective owner

Related posts about css

Related posts about html