From http://webdesign.about.com/od/htmltags/p/aadivtag.htm
In HTML 4, the DIV element cannot be inside another block-level element, like a P element. However, in HTML5 the DIV element can be found inside and can contain other flow content elements, like P and DIV.
I have something like this inside a form
<p> <label...> <input...> </p>
but when Rails auto-generates an error_explanation div wrapping the input, the one paragraph turns into two, and I see this in Firebug:
<p> <label...> </p> <div...> <input...> </div> <p> </p>
Also, if I just add a simple
<p> <div> test </div> </p>
the same issue occurs (JSFiddle) and it gets rendered in the DOM as
<p> </p> <div> test </div> <p> </p>
Why?
I later e-mailed the author of the article and she made the appropriate changes.