elements 4

HTML elements are defined as a command that tells a browser to do something e.g. <title> tag pair. Everything inside the HTML tags is known as element contents. The start/opening tag defines the start of a HTML element. Similarly, the end/closing tag defines the end of a HTML element.

Example 1:

The <html> element defines whole html file. Similarly <head> element defines title of document using another <title> element.


Some HTML tags have nothing inside them. Such HTML elements are empty. Empty elements are often closed in start tag.

Example 2:

The line break tag is used to insert a line in document layout. It is closed in the start tag. Moreover it does not contain any content so it is empty element. e.g. </br>

HTML elements can also contain some attributes. e.g.

<a href=”index.html”> index</a>

In this example href is given as an HTML attribute to the <a>…</a> tag.

For more visit next posts in this category.To go back to Contents of this tutorial: Contents of HTML Tutorial


2 Responses to HTML ELEMENTS (4)

  1. Awesome article! I just bookmarked it.

  2. Would it be possible post this to one of my websites on this topic? I’ll give you full credit, of course. Let me know what you think. :)

Leave a Reply