Second code is incorrect, since <p> tag cannot contain other block elements, which <div> is. Therefore, I assume your first code should be ok. However, it is hard to say without knowing what you're trying to do. First code is at least valid, while the second one is not.