3

If I place a div element inside an anchor element, it invalidates my HTML.

What is the reason of not placing block level elements inside inline elements ?

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
Sachin Jain
  • 21,353
  • 33
  • 103
  • 168

1 Answers1

6

If I place a div element inside an anchor element, it invalidates my HTML.

This is not true as of HTML5.

What is the reason of not placing block level elements inside inline elements?

The HTML specification describes which elements may contain other elements. "Flow content" can often contain "Flow Content", or "Phrasing Content", but even this is not always the case. For example, a p element is a block level element, but it may only contain "Phrasing Content".

TylerH
  • 20,799
  • 66
  • 75
  • 101
zzzzBov
  • 174,988
  • 54
  • 320
  • 367