Locked lesson.
About this lesson
Understanding the difference between block and inline elements, and when to use each.
Exercise files
Download this lesson’s related exercise files.
Block Vs. Inline Elements.docx59.2 KB Block Vs. Inline Elements - Solution.docx
59.2 KB
Quick reference
Block Vs. Inline Elements
In this video we'll learn the difference between a block and an inline element.
When to use
When you need something to take up the entire space available, use block and when you need to fit something inline with something else, use inline.
Instructions
HTML elements are either block or inline.
Block elements, like the p tag, take up the entire space available on a line.
Inline elements, like a link tag, image tag, or span tag only take up the space where they sit, not the entire block.
Hints & tips
- P tags are block
- H1 tags are block
- Links are inline
- Images are inline
- Strong and EM are inline
- Block tags take up the entire width available
- Inline tags only take up the space they are in
Lesson notes are only available for subscribers.