Block vs. Inline HTML Elements

Block

  • Occupies entire horizontal ‘row’
  • ‘Listens’ to margin padding, and text-align rules
  • Does not allow for side-by-side content in browser
  • Examples include: h1, h2, h3, ul, ol, li, div, p

Inline

  • Only as wide as its content
  • does not ‘listen’ to margin, padding, or text-align
  • Allows content to show side-by-side
  • Examples include: a, span

More on the CSS ‘display’ property can be found here: https://css-tricks.com/almanac/properties/d/display/

This entry was posted in Uncategorized. Bookmark the permalink. Follow any comments here with the RSS feed for this post. Both comments and trackbacks are currently closed.