• Have Any Question?
  • contact@eitworld.com

HTML Block





All html elements can be categorized into two parts:

a) HTML Block Elements

b) HTML Inline Elements.

HTML Block Elements

  • Block elements usually start and end with a line break at the time of execution.
  • <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <p>, <pre>, <ul>, <ol>, <dl>,<table>, <hr> and <blockquote> etc are the example of HTML block elements.

HTML Inline Elements

  • Inline elements usually displayed without a line break at the time of execution.
  • <a>, <b>, <i>, <u>, <em>, <strong>, <td>, <img>, <li>, <small>, <ins>,<sub>, and <sup> etc are the example of HTML inline elements.

HTML Grouping tags

There are two grouping tags in HTML:

a)The <div> tag

b)The <span> tag

The <div> tag

  • <div> tag is a block element which is used as the container for the other html elements.
  • <div> tag is basically used for applying CSS style to the group of html elements.
  • Like other block elements <div> tag alsostart and end with a line break at the time of execution.
  • Here is an example of <div> tag:
<!DOCTYPE html >
<html>
<body>
<div style=”background-color:yellow; color:black; padding:15px;”>
<h1>Android</h1>
<p>Android is an OS that has been developed too rapidly and gained popularity historically. In last few years, it developed so many versions and now Android is at the peak in mobile phone operating systems. It is now being used in smart TVs, Washing Machines also. </p>
</div>
</body>
</html>

To see live output : Visit Try Yourself Editor

Output

The <span> tag

  • <span> tag is an inline element which is used as the container for the other html elements.
  • <span> tag is basically used for applying CSS style to the group of html elements.
  • Like other inline elements <span> tag display without line breaks at the time of execution.
  • Here is an example of <span> tag:
<!DOCTYPE html >
<html>
<body>
<p>This is <span style=”color:pink”> example of span tag.</span></p>
</body>
</html>

To see live output : Visit Try Yourself Editor

Output



Real Time Web Analytics