HTML & CSS · Junior · Question 4 of 75
How does <div> differ from <span> by default?
- 1
<div>is an inline element,<span>is a block element - 2No difference: they are synonyms, only the tag name differs
- ✓Correct answer:
<div>is a block element,<span>is an inline element
Explanation
<div> has display: block by default: it stretches to the full width of its parent and starts on a new line. <span> has display: inline: it flows within text and is as wide as its content. Neither carries semantics - both are containers for grouping and styling.