What are the differences between inline and block elements?

Inline elements (e.g., <span>, <a>) only take up as much space as needed, while block elements (e.g., <div>, <p>) occupy the full width available.

Example:

<p>This is a <span>span element</span> within a paragraph.</p>