2nd November, 2022

Every HTML element has a default display value, which can either be block or inline.

Block-Level Elements

A block-level element always starts on a new line, and the browsers automatically adds a margin before and after the element.

A block-level element always takes up the full width available (entire space on the screen).

Some commonly used block elements are: p, div, nav, main, and li.

  • The p element defines a paragraph in an HTML document.

  • The div element defines a division or a section in an HTML document.

  • The nav element defines a set of navigation links.

  • The main element specifies the main content of a document.

  • The li element defines a list item.

  • Here are some Block-level elements in HTML -

    Block-Level Elements

    Inline Elements

    An inline element does not start on a new line.

    An inline element only takes up as much width as necessary.

    Some commonly used inline elements are: span, button, img, and br.

  • The span element is an inline container used to mark up a part of a text, or a part of a document.

  • The button element defines a clickable button.

  • The img element is used to embed an image in an HTML page.

  • The br element inserts a single line break.

  • Here are some Inline elements in HTML -

    Inline Elements

    Thanks for Reading🌻