Div inside a p : Invalid HTML
I was trying to center an element using the p tag. Like :
<p style="margin-left:auto; magin-right:auto; width: 50 em;">
<%= show_simple_captcha %>
</p>
show_simple_captcha is a helper method from the simple captcha rails plugin. This view helper generates a div which helps in captcha validation. Now, this created a problem. This piece of code started to behave randomly in IE. Even the source generated in Firefox is invalid HTML. After much scratching arnd, I found that <div> tags are not allowed inside <p> tags. Strange !! I dont have a reason of the top of my head as to why this is disallowed, but this is invalid W3C HTML.
