HTML Elements

An HTML doument is described by HTML element. There ar four basic elements of HTML. They are html, head, title and body.

there are a lot of element in html. They start with opening tag and end with closing tag. Between the opening and closing tag there remain content of the element.

Everything from the opening tag to closing tag are called HTML element.

Example:

<p> Content of the Element </p>


Features of HTML Element

  1. Start with opening tag.
  2. End with closing tag.
  3. There are element content between the opening and closing tag.
  4. All the elements are not required the closing tag. They are called void element.

Example of void elements:

<p> This is an example of <br> void element </p>

In the example <br> is a void element. It has no ending tag.


Categories of HTML Elements

Depending on the default view and style, HTML elements ar divided into two parts.

  • Inline element
  • Block level-element

Inline Element: Inline element does not cause for a line break or does not start with a new line. It also does not take the whole wide of a webpage. Generally it is used between other HTML elments.
Example: <i>, <img>, <a>, <em>, <b>, <input> etc.

Block-level Element: Block-level element always start with a new line. It also takes the whole wide of a webpage. Other HTML elements can be used between the Block-level element.
Example: <div>, <article>, <p>, <h1> to <h6>, <ul>, <li>, <ol> etc.