Problem with IE when using display:block for links

前端 未结 7 1837
半阙折子戏
半阙折子戏 2021-02-07 15:50

This is my HTML:

Link 1 Link 2 Link 3 <
相关标签:
7条回答
  • 2021-02-07 16:20

    Enclose the link text in a span element. Then it will accept clicks anywhere within its bounds.

    0 讨论(0)
  • 2021-02-07 16:23

    I have no idea why, but giving the anchor a background color seemed to fix this problem for me.

    0 讨论(0)
  • 2021-02-07 16:28

    Put position:relative; in your CSS at #links a{ }

    like this

    It will fix it :)

    0 讨论(0)
  • 2021-02-07 16:29

    Setting the background color to #FFF and an opacity of 0 worked for me in IE9, Chrome and Firefox. Don't know about other versions though. Setting it to transparent didn't help me.

    This has the advantage of being pure CSS and cross-browser, so maybe it could be a better alternative.

    0 讨论(0)
  • 2021-02-07 16:38

    Insert this inside your a-tag style:

    background:url('images/dot.png') no-repeat;
    

    where dot.png is a 1x1 transparent image.

    0 讨论(0)
  • 2021-02-07 16:39

    Ok, the fix for this problem is to give the anchors a background property other than transparent. Some proposed to give the anchors a transparent background image. I have an addition to this: The image does not have to exist. You can simply write any path and it will make it work:

    a {
      background:url('dummy/doesnotexist.png') no-repeat;
    }
    
    0 讨论(0)
提交回复
热议问题