Block and inline elements in HTML

Each element in HTML has a default display value, depending on which element it is.

Each element in HTML has a default display value, depending on which element it is. The default display value of most elements is block or inline.

Block elements

Block elements usually start at the beginning of the line and take up the full width possible (from left to right)

  1. address
  1. dt
  1. hr
  1. article
  1. fieldset
  1. li
  1. aside
  1. figcaption
  1. main
  1. blockquote
  1. figure
  1. nav
  1. canvas
  1. footer
  1. noscript
  1. dd
  1. form
  1. ol
  1. div
  1. h1-h6
  1. output
  1. dl
  1. header
  1. p
  1. pre
  1. table
  1. ul
  1. section
  1. tfoot
  1. video

Inline element

The inline element does not start a new line and takes only the required width.

Inline Elements in HTML

  1. a
  1. cite
  1. label
  1. abbr
  1. code
  1. map
  1. acronym
  1. dfn
  1. object
  1. b
  1. em
  1. q
  1. bdo
  1. i
  1. samp
  1. big
  1. img
  1. script
  1. br
  1. input
  1. select
  1. button
  1. kbd
  1. small
  1. span
  1. strong
  1. sub
  1. sup
  1. textarea
  1. time
  1. tt
  1. var

div element

The div element is usually used to contain other HTML elements, it has no required attributes but style, class and id are common attributes. When used with CSS, the div element can be used to style the content block.

span element

The span element is usually used to contain text elements in HTML, it has no required attributes but style, class and id are common attributes. When used with CSS, the span element can be used to style the content block.

4.5 ★ | 2 Vote