Menu
HTML Fundamentals
Block vs Inline Elements
Two fundamental display behaviors that shape every layout.
1Block & Inline
Block elements (div, p, h1, section) start on a new line and fill the available width. Inline elements (span, a, strong, em) flow within text and only take up the space they need.
Example Code
<div>Block — full width line</div>
<p>Block paragraph.</p>
<span>Inline</span> sits next to <a href="#">Inline links</a>.Finished reading?
Mark this topic as complete to track progress.