How do I make an tag the size of it's parent
  • tag for larger clickable region?
  • 前端 未结 7 1410
    我在风中等你
    我在风中等你 2020-12-08 04:11

    I would like to do this so that the clickable region on the tag is size of the LI.

    My html looks like:

  • 7条回答
    •  星月不相逢
      2020-12-08 04:57

      Just another option I used is create a transparent png image in photoshop and put it inside the anchor tag, make its position absolute and increase its dimensions to fit that parent div you want and you could have a large clickable area.

      
       
      
      
      #cover_img {
      display: block;
      height: 200px;
      width: 193px;
      position: absolute;
      }
      

      Might be useful in certain circumstances.

    提交回复
    热议问题