Welcome to Episode 18 of the Learn HTML series! In this episode, you’ll learn the difference between block-level and inline elements — an essential part of understanding how elements behave in a web page layout.
By the end of this episode, you’ll be able to:
- Understand what block-level elements are
- Identify common inline elements
- Learn how each type affects layout and styling
- Know when to use which
Block-level elements always start on a new line and take up the full width available.
<div><p><h1>to<h6><section><article><header>,<footer><form><ul>,<ol>,<li><table>
Inline elements do not start on a new line and only take up as much width as necessary.
<span><a><strong>,<em><img><input><label>
<!-- Block-level -->
<div>
<p>This is a block-level element</p>
</div>
<!-- Inline -->
<p>This is an <span>inline</span> element</p>You can change the display type of any element using CSS:
span {
display: block;
}
div {
display: inline;
}➡️ Episode 19: HTML5 Layout Tags (header, footer, nav, section, etc.)
In the next episode, we’ll dive into semantic layout tags introduced in HTML5 and understand how they help in building meaningful structure and accessible web content.