Is putting a div inside an anchor ever correct?

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

    Just as an FYI.

    If your goal is to make your div clickable you can use jQuery / Java Script.

    Define your div like so:

    This is my div. Try clicking it!

    Your jQuery would then be implemented like so:

     
    

    This would also work for multiple divs - as per Tom's comment in this thread

提交回复
热议问题