<DIV> is more like a paragraph and <SPAN> is not.
The DIV element gives you the chance to define the style of whole sections of the HTML. You can define a division of your page as a call out and give that area a different style from the surrounding text.
Because the CENTER element has been deprecated in HTML 4.0 and is obsolete in HTML5, it is a good idea to start using
to center the content inside your DIV.
The SPAN element has very similar properties to the DIV element, in that it changes the style of the text it encloses. But without any style attributes, the SPAN element won't change the enclosed items at all.
Code: Select all
In a sentence you can change <span style="color: red;">a word to red</span> without breaking with spaces and newlines.
Hopes this clears things up.