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


#1

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.


FAQ: Learn HTML Elements – Intro to HTML – Displaying Text
#2

Además se pueden dar atributos como los ID en elementos como los

y los