Explain?
The main difference between <div> and <span> is their default behavior. By default <div> is a block level element and <span> is a inline element.
Without breaking the current line element, just to add a small portion of text we will use <span>.
If you need to modify a large division, the height, move an element, or contain other elements, we will use a <div>.
Div is a block-level-element &
Span is an inline-element.
----------------------------------
Example:
<div> Html </div>
<div> and </div>
<span> Css </span>
<span> Javascript </span>
----------------------------------------
Output for the above example will be as shown
Html
and
CssJavascript
-------------------------------------------------------
As you can see
'div' elements 'Html', 'and' are displayed in a separate line..this is because 'div' is a block level element and it takes up the enire row for each 'div' element whereas 'span' takes up only the space required for the word that is why 'Css','Javascript' are displayed on the same line