Make whole
  • as link with proper HTML
  • 前端 未结 9 2252
    忘掉有多难
    忘掉有多难 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:40

      a sir you use jquery ? if yes, you can try it :

      $("li").click(function(){
         $(this).find('a').click();
      });
      

      or you could use it too as css:

      li{
        position:relative;
      }
      li a {
        position:absolute;top:0px;left:0px;width:100%;height:100%;
      }
      

      Choose one ... Good luck

    提交回复
    热议问题