Home Blog Frontend Technologies

Div and Span

Published:


What is the difference between HTML tags 
and ? div is a block element, span is inline. This means that to use them semantically, divs should be used to wrap sections of a document, while spans should be used to wrap small portions of text, images, etc. For example:
This a large main division, with a small bit of spanned text!
Note that it is illegal to place a block level element within an inline element, so:
Some text that
I want
to mark
up
...is illegal. added on 10-Feb-2018
Comment