What are the Elements, Tags, and Attributes in HTML?

HTML, or Hypertext Markup Language, is a standard markup language used for creating web pages and applications.

It is the backbone of the World Wide Web and is the most basic building block of any website.

HTML defines the structure and content of web pages using a series of tags and attributes that identify different elements such as headings, paragraphs, images, links, and forms.

These tags and attributes enable web developers to create rich, interactive content that can be accessed by anyone with a web browser.

HTML is constantly evolving, and the latest version, HTML5, introduced new features such as video and audio support, canvas for graphics rendering, and improved accessibility features.

Learning HTML is essential for anyone interested in web development or building web-based applications, and it is a skill that can be easily acquired with online tutorials and courses.

Hire Dedicated Web Developers

History of HTML

HTML has its roots in the early days of the internet when Tim Berners-Lee, a software engineer at CERN, developed a system for organizing and sharing information among scientists.

This system, called the World Wide Web, relied on a markup language that would allow web pages to be formatted and linked together.

Berners-Lee created the first version of HTML in 1989, using SGML, a markup language for documents, as its basis.

The original version of HTML was simple, with only a handful of tags for formatting text and creating hyperlinks.

Over the years, HTML evolved to include more tags and features, leading to the release of HTML 2.0 in 1995 and HTML 3.2 in 1997.

The development of CSS (Cascading Style Sheets) and JavaScript in the late 1990s further expanded the possibilities of web design and interactivity.

HTML 4.0 was released in 1997 and remained the standard version of HTML until the release of HTML5 in 2014, which introduced new features such as native video and audio support and improved accessibility options.

Today, HTML remains the foundation of the web, allowing developers to create rich and dynamic web pages that can be accessed by anyone with an internet connection.

HTML uses various elements, tags, and attributes to define the structure and content of web pages which we will understand with the sections elaborated below.

Hire Dedicated Web Developers


HTML elements are the building blocks of web pages.

An element is defined by its opening and closing tags, which contain content and attributes.

The content between the opening and closing tags is the text, images, links, and other elements that make up the web page.

For example, the<p>element is used to create a paragraph.

The opening tag is<p>and the closing tag is</p>.

Anything written between these tags will be displayed as a paragraph on the web page.

Here is an example:

<p>This is a paragraph.</p>


HTML tags are used to define elements on a web page.

They are enclosed in angle brackets (<>) and can be divided into two types: opening tags and closing tags.

Opening tags are used to start an element and include the name of the element.

Closing tags are used to end an element and include a forward slash (/) before the element name.

For example, the<h1>tag is used to create a heading. The opening tag is<h1>and the closing tag is</h1>.

Anything written between these tags will be displayed as a heading on the web page. Here is an example:

<h1>This is a heading</h1>


HTML attributes are used to modify the behavior or appearance of an element.

They are always included in the opening tag and consist of a name and a value, separated by an equal sign (=).

The most commonly used attributes include id, class, src, href, alt, and style.

For example, the<img>tag is used to display an image on a web page.

The src attribute specifies the source URL of the image. Here is an example:

<img src="image.jpg" alt="This is an image">

In this example, “image.jpg” is the source URL of the image and “This is an image” is the alternative text that will be displayed if the image cannot be loaded.

HTML also includes a number of global attributes that can be used with any element.

These include id, class, style, title, and tabindex.

Here is an example of how to use the class attribute to style an element:

<h1 class="heading">This is a heading</h1>


.heading {
  color: blue;
  font-size: 24px;


In this example, the class attribute is set to “heading”. The CSS style sheet then defines the style for the “heading” class, setting the color to blue and the font size to 24 pixels.


HTML elements, tags, and attributes are the foundation of web development.

Understanding how to use them is essential for creating web pages and applications that are accessible and easy to use.

By using the right elements, tags, and attributes, you can create web pages that are both visually appealing and functional.

Moreover, this article is curated by the content experts at Accrete Infosolution Technologies LLP, a reliable web development service provider that has years of expertise in providing IT services across the globe. Contact us today for any web development related queries.

Hire Dedicated Web Developers

Also read:

Find an agent now


+91 079 232 13063

Time Schedule

Office Time

Mon - Fri: 9:00 - 18:00