What is the difference between content that is inline vs blocks of content?

Question

This exercise discusses dividing your content into blocks. What is the difference between content that is inline vs blocks of content?

Answer

As the exercise alludes to, there exists block-level elements (<div>, <p>, etc.) and inline-level elements (<span>, etc). One of the big differences between these two types of elements is that a block element will take up the entire width of its containing element. This means that by default <div> and <p> elements will push sibling elements to a new line or section of the page.

On the other hand, inline elements make more conservative use of space. They take up only as much space as they need and will not force surrounding content to a new line.

44 Likes

a Very good response. Thank you

8 Likes

I’ve been curious about this too. thx

2 Likes