Is putting a div inside an anchor ever correct?

前端 未结 14 2834
孤独总比滥情好
孤独总比滥情好 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:24

    I think that most of the time when people ask this question, they have build a site with only divs, and now one of the div needs to be a link.

    I seen someone use a transparent empty image, PNG, inside an anchor tag just to make a link inside a div, and the image was the same size as the div.

    Pretty sad actually...but it works...

提交回复
热议问题