Introduction

Block Elements:

  • Behavior: Block elements start on a new line and take up the full width available by default.
  • Examples: <div>, <p>, <h1> to <h6>, <section>, <article>
  • They are typically used for larger structures like paragraphs, headings, and containers. Each block element stacks vertically, one after the other.

Inline Elements:

  • Behavior: Inline elements do not start on a new line and only take up as much width as needed by their content.
  • Examples: <span>, <a>, <img>, <strong>, <em>
  •  They are used for smaller pieces of content within a block element, such as text formatting, links, and images. Multiple inline elements can appear side by side within a block element.

Block Level Elements

Inline Level Elements

Meta Tags