The technical difference is that the div is a block level element, and the span is an inline element for use with text. Although gaps can be displayed and behave like block elements, by their nature they are still considered inline elements and therefore cannot contain block elements as valid HTML.
div may contain a span , but a span cannot correctly contain a div , even if you apply display: block or display: inline to all of them.
As others mention, you use divs as building blocks to define the layout and structure of your pages, while you use span to wrap parts of your text, for styling or structural purposes.
Some links to the HTML specification:
div - common stream container
Allowed Content
Zero or more stylish elements followed by flow.
... where the content of the stream consists of the contents of the phrase and many block-level elements (stream elements).
span - general range
Allowed Content
The content of phrases.
... where phrasing content consists of text and inline elements.
source share