Is putting a div inside an anchor ever correct?

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

    If you change it to a block-style element, then no, it's no longer 'wrong', but it probably won't validate. But it doesn't make much sense to do what you're doing. You should either just keep the anchor tag as a block level element with no inner div, or put the div on the outside.

提交回复
热议问题