Block and Inline

HTML consists of two type of elements. BLOCK and INLINE. What's the difference? let's find out!

Published on

Monday, Apr 13, 2020

In this lecture, I will explain the fundamental difference between BLOCK and INLINE elements.

Block Element

Any HTML element which takes full available width no matter what is an block element.

Some of the block elements are mentioned below:

Inline Elements

Any element which takes only the required space is an inline element. Inline elements can sit next to other on same line (if sufficient width is available).

here are some inline elements:

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

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>HTML COURSE</title>
  </head>
  <body>
    <h1>I am a block element</h1>
    <span>I am an inline element</span>
  </body>
</html>

I hope you will like it. If you face any issue or have any doubt please connect with me via facebook messenger chat floating on the right side of the screen :)

happy learning :)

Follow me on Instagram