How do I make the whole area of a list item in my navigation bar, clickable as a link?

前端 未结 10 1979
栀梦
栀梦 2020-11-27 13:50

I\'ve got a horizontal navigation bar made from an unordered list, and each list item has a lot of padding to make it look nice, but the only area that works as a link is th

10条回答
  •  借酒劲吻你
    2020-11-27 14:17

    Define your anchor tag css property as:

    {display:block}
    

    Then the anchor will occupy the entire list area, so your click will work in the empty space next to your list.

提交回复
热议问题