w1coding.comAll tutorials

HTML Block And Inline

HTML lessons
  1. Environment Setup
  2. Introduction
  3. Basics
  4. Editors
  5. Elements
  6. Attributes
  7. Heading
  8. Paragraphs
  9. Styles
  10. Formatting
  11. Quotations
  12. Comment
  13. Colors
  14. CSS
  15. Links
  16. Images
  17. Favicon
  18. Title
  19. Tables
  20. Block And Inline
  21. Lists
  22. Div
  23. Classes
  24. ID
  25. Iframes
  26. Responsive

Block-Level Elements

This is a Block-Level Element

Block-level elements take up the full width available and create a new line. They can contain other block or inline elements.

This is another block of content, which can also contain inline elements like links here or italicized text.

Inline Elements

Inline elements, like this span, only take up as much width as necessary and do not start a new line.

For example, the following sentence contains inline elements: inline elements can sit next to other inline elements.

Comparison of Block and Inline Elements

Here’s a quick comparison:

  • Block Elements: Start on a new line, take full width.
  • Inline Elements: Do not start on a new line, only take up as much width as necessary.