Quote:
Originally Posted by Hitch
Divs and ps are both block-level elements; they can contain other elements, and frequently do. It's not like you're talking the difference between one element that's a block and one that's an inline, here. A div is a container, pretty much--and arguably, for all intents and purposes, so is a paragraph. A paragraph contains text; it can contain images, etc.
|
As far as being a container goes, they are different: a
div can contain other block elements. A
p cannot.
To me,
div is better style in this case. The major difference (aside from the functional one I just mentioned) is that
p connotes that the contents are a paragraph, semantically. That’s not the case here, so
div is a little better in terms of expressing what’s meant. But that’s just a style difference; neither one is wrong
per se.