Is putting a div inside an anchor ever correct?

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

    No it won't validate, but yes it generally will work in modern browsers. That being said, use a span inside your anchor, and set display: block on it as well, that will definitely work everywhere, and it will validate!

提交回复
热议问题