Blocking and Non Blocking elements in HTML

Html elements are two types blocking and non blocking element.

1.Blocking Elements:

Bocking elements are display  line break before and after the element.

These elements always starts with new line.

Blocking elements must have start and end tag.

These elements are occupies full width.

Example :

  • <div></div>
  • <p></p>
  • <li></li>
  • <ol></ol>
  • <pre></pre>
  • <nav></nav>

2.NonBlocking Elements:

These elements are also called as Inline elements.

It will not start with new line and takes necessary space or width.

some non blocking elements does not have end tag.

Example :

  • <a>
  • <img>
  • <br>
  • <span></span>
  • <strong></strong>

Programming Example:

<div style="background-color:#eee">
  <p>
     <strong>CodeFame.in</strong>
  <br>
    <a href="http://www.codefame.in">Codefame.in</a> is a online coding / programming tutorial for programmers in all over world.
  </p>
</div>

Output:

CodeFame.in

Codefame.in is a online coding / programming tutorial for programmers in all over world.