Every HTML element is either block or inline by default.
Block elements
Start on a new line and take the full width. Examples: <div>, <p>, <h1>–<h6>, <ul>, <table>, <form>.
Inline elements
Stay in the same line and take only the space they need. Examples: <span>, <a>, <strong>, <img>, <input>.
div and span
<div>is a generic block box — used to group sections for styling.<span>is a generic inline box — used to style part of a sentence.
Example
Example — div vs span
HTML
<div style="background: #e3f2fd; padding: 10px;">
This is a div. It takes the full width.
</div>
<div style="background: #fce4ec; padding: 10px;">
Another div starts on a new line.
</div>
<p>
This sentence has a <span style="color: red; font-weight: bold;">red span</span> inside it,
and it stays on the same line.
</p>