Describe the difference between inline and block elements in HTML.

1 Answers
Answered by suresh

```html

Inline vs Block Elements in HTML

Inline vs Block Elements in HTML

Inline elements in HTML:

  • Do not start on a new line and only take up as much width as necessary
  • Examples include <span>, <a>, <img>
  • Cannot have margins or padding applied to them

Block elements in HTML:

  • Start on a new line and take up the full width available
  • Examples include <div>, <p>, <h1>
  • Can have margins, padding, and width and height set

It's important for UI Developers to understand the differences between inline and block elements in HTML in order to properly structure and style web content.

```

Answer for Question: Describe the difference between inline and block elements in HTML.