Block & Inline Elements

W3 Schools Reference Page

CSS Home

A <div> tag is a block-level element that starts on a newline and stretches across the entire width of the page. You can use a <div> tag to apply styles to all the elements nested inside it.

A <span> tag is an inline element that does not start a newline and only takes up as much space as needed. You can use a <span> tag to apply styles to a particular element without disrupting the flow of the other elements on the page.

This is an example of how you can use a <div> tag to center a block but not center the text within that block.
  1. First things first
  2. Then do the second thing
  3. And finally, the last thing

This is an example of a paragraph that contains custom styling for just a few words right in the middle of the sentence.

The <div> Tag

The <span> Tag