Is putting a div inside an anchor ever correct?

前端 未结 14 2884
孤独总比滥情好
孤独总比滥情好 2020-11-21 05:43

I\'ve heard that putting a block element inside a inline element is a HTML sin:

What we have here is a
14条回答
  •  渐次进展
    2020-11-21 06:49

    you can achieve this by adding "::before" Pseudo-element

    Pure CSS Trick ;)

    a:before{
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      z-index: 1;
      pointer-events: auto;
      content: "";
      background-color: rgba(0,0,0,0);
    }
    
    
    ...
    Card with stretched link

    Some quick example text to build on the card title and make up the bulk of the card's content.

    Go somewhere

提交回复
热议问题