Make whole
  • as link with proper HTML
  • 前端 未结 9 2097
    忘掉有多难
    忘掉有多难 2021-02-02 13:23

    I know this has been up a lot of times before, but I couldn\'t find any solution in my specific case.

    I\'ve got a navigation bar and I want the whole

  • 相关标签:
    9条回答
    • 2021-02-02 13:58

      I think you may have meant inline-block, not inner-block:

      li a {display: inline-block; height: 100%; width: 100%; }
      

      Also, inline-block has its own set of problem with older IE browsers, and probably won't react how you'd expect.

      0 讨论(0)
    • 2021-02-02 14:00

      Just format the a directly instead of the li with your styles.

      I have alterd your fiddle http://jsfiddle.net/BrcZK/1/

      0 讨论(0)
    • 2021-02-02 14:02

      Here's what I do:

      a { display: block; }
      

      Then style the anchors as I see fit.

      Here's the fiddle: http://jsfiddle.net/erik_lopez/v4P5h/

      0 讨论(0)
    提交回复
    热议问题