HTML5
Beginner
Basics
· 1 min read
div vs span
When do I use div or span?
Block vs inline containers.
Example
Interactive preview available<div class="card">
<span class="badge">New</span>
<p>Card body</p>
</div>
Line-by-Line Walkthrough
Prefer semantic tags when they fit the meaning.