HTML/CSSBeginner#html#elements

What is the difference between <div> and <span>?

<div> is a block-level generic container used to group larger sections of content, taking full width. <span> is an inline generic container used to wrap small pieces of text or inline elements without breaking flow.

Example
<div class="card">
  <span class="badge">New</span> Product Title
</div>

Related Questions

1
HTML/CSSBeginner#html#doctype

What does the DOCTYPE declaration do?

Open
2
HTML/CSSIntermediate#html#doctype

What is quirks mode vs standards mode?

Open
3
HTML/CSSBeginner#html#meta

What are the important meta tags in an HTML document?

Open