HTML Tag Elements

What is a Tag? and know about HTML Tags.

In this HTML chapter you will learn about HTML elements. HTML documents are composed of elements. Each element starts with a start tag, followed by the element's content and ends with a end tag. 

  • Some HTML elements do not have a end tag or content.
  • HTML elements are not case sensitive but it is advised that you should use lower-case for HTML elements.
  • HTML elements can be nested to create a structure document.
  • If you forget to close the end tags, it may work in most of the modern web browsers. As a best practice, this behavior should not be relied upon.

The general HTML element format is,


Following is an example of a paragraph element:

<p>This is a HTML Paragraph.</p>

Example of an empty HTML element which inserts a line break in the HTML document flow. HTML5 does not require to add a slash at the end to tag descriptor.


HTML Elements

Following is a set of HTML tag elements that are frequently used. We will see about the complete set in the coming chapters.

<p> HTML Paragraph content. </p>

<h1> HTML Heading One </h1>

<h2> HTML Heading Two </h2>

<b> Bold Style Element </b>

<u> Underline Style Element </u>

<i> Italic Style Element </i>

<code> Code snippet </code>

Empty HTML Elements:

<br> - HTML break introduces a new line in the HTML document.

<hr> - Adds a horizontal line.

HTML Meta Elements:

<title> HTML Web Page Title </title>

<link rel="stylesheet" type="text/css" href="style.css" >

HTML Example Web Page

<!DOCTYPE html>
<title>An Example Web Page</title>
<h1>Example HTML</h1>
<p>This is an example HTML web page.</p>
<p>This is the <b>second</b> paragraph.</p>

Exception Occured:

Messageerror_log(app.log): Failed to open stream: Permission denied
Trace#0 (): log_error(2, 'error_log(app.log): Failed to open stream: Permission denied', '/home/dh_czz6eb/', 36)
#1 /home/dh_czz6eb/ error_log('16-04-2024 00:25:54 am (IST),/home/dh_czz6eb/,193,0,ErrorException,Optional parameter $per_page declared before required parameter $href is implicitly treated as a required parameter,/html/html-tag-elements.html,#0 /home/dh_czz6eb/ log_error(8192, 'Optional parame...', '/home/dh_czz6eb...', 193)
#1 [internal function]: check_for_fatal()
#2 {main}
', 3, 'app.log')
#2 /home/dh_czz6eb/ log_exception(ErrorException)
#3 /home/dh_czz6eb/ log_error(8192, 'Optional parameter $per_page declared before required parameter $href is implicitly treated as a required parameter', '/home/dh_czz6eb/', 193)
#4 (): check_for_fatal()