What is the difference between Span and Div tag

There is one difference between div and span. In standard HTML, a div is a block-level element whereas a span is an inline element. The div block visually isolates a section of a document on the page, in the same way as a paragraph. The span element contains a piece of information inline with the surrounding text.

In HTML, the span and div elements are used where parts of a document cannot be semantically described by other HTML elements.

Most HTML elements carry semantic meaning – i.e. the element describes, and can be made to function according to, the type of data limited within. For example, <a> <p> element should contain a paragraph of text, while an <h1> element should have the highest-level header of the page; user agents should differentiate them accordingly. However, as span and div have no natural semantic meaning besides the logical grouping of the content, they can be used to specify non-standard presentation or behavior without extra semantic meaning.


Social Bookmarking