What is the difference between <div> and <span>?
- <div> is a block-level element (creates a full-width container).
- <span> is an inline element (used for styling small text portions).
Example:
<div>Block Section</div>
<p>This is a <span style="color: red;">red word</span> in a
sentence.</p>
Key Takeaway:
Use <div> for layout; <span> for inline styling.