Search anything:

Comprehensive Guide to HTML tags

Binary Tree book by OpenGenus

Open-Source Internship opportunity by OpenGenus for programmers. Apply now.

HTML, or Hypertext Markup Language, is the standard language used to create web pages and web applications. HTML provides a set of markup tags and attributes that define the structure and content of a web page. By using HTML, developers can create text, images, videos, forms, and other media, and define their layout and presentation on the web.

Learning HTML is a crucial first step for anyone interested in web development, as it forms the foundation upon which the rest of the web technologies, such as CSS and JavaScript, are built. With HTML, you can create basic static websites, as well as more complex dynamic web applications.

This HTML cheat sheet at OpenGenus provides a comprehensive list of all the essential HTML tags and their attributes, making it an excellent resource for both beginners and experienced developers. The cheat sheet covers everything from the basics, such as headings, paragraphs, and lists, to more advanced topics, such as tables, forms, and multimedia.

To give you an idea of what working with HTML looks like, here's an example of how to create a basic web page:

<!DOCTYPE html>
	<title>My First Web Page</title>
	<h1>Welcome to My First Web Page</h1>
	<p>This is the content of my web page.</p>

This HTML code creates a simple web page with a heading and a paragraph of text.

If you are a beignner to HTML you would love to hear that if you place the above text in a notepad file - .txt and save it as name.html you just now created a web page. try opening the file using a browser, just double click it. Here you have it, your first Webpage!

Whether you're a beginner or an experienced developer, mastering HTML is an essential part of creating successful web projects. So, let's dive into the world of HTML and explore all the powerful tools it has to offer!


Doctype Tag

declares the document type for browsers

<!DOCTYPE html>

html Tag

prime tag to start writing html file code

<html>contains all data and tags of the html file</html>

Head Tag

Container for metadata

<head>Head text</head>


Head Text

Title Tag

The title of your project - present inside Head tag

<title>title text</title>

Body Tag

Container for data and context

<body>body text</body>


body Text

meta Tag

specify the character set, page description, keywords, author of the document, and viewport settings for SEO

<meta />


link Tag

link to external style sheets and files

<link rel="stylesheet" href="" />



style Tag

used to define style information for a single document - inline css

<style>/*CSS commands*/</style>

HTML Semantics

header Tag

Specifies a header for a document or section

<header>header text</header>

main Tag

Specifies the main content of a document


footer Tag

Defines a footer for a document or section

<footer>footer text</footer>

article Tag

Defines independent, self-contained content

<article>article context</article>

Defines navigation links

<nav><a href="/html/">HTML</a> | <a href="/css/">CSS</a> | <a href="/js/">JavaScript</a></nav>

section Tag

Defines a section in a document

<section>section context</section>

aside Tag

Defines content aside from the page content

<aside>aside context</aside>

figure Tag

Specifies self-contained content - Embeds annotated images, illustrations, photos, code, etc.


figure Tag

For adding a caption/annotation to the figure tag


picture tag

Responsive image insertion,allows developers to provide different images for different contexts.


Image Tag

just like picture tag it ios used to add images

You can add image if it is stored in your working space like this:
<img src="img_girl.jpg" width="400" height="400" />

Or you can add image directly from your browser like this:



Container for SVG graphics

<svg src=""></svg> 

video tag

For embedding videos into a website.

<video poster=" " autoplay loop controls ><source></source></video>

poster is the path to an image that’s displayed before the video plays.


<video controls src="movie.mp4" type="video/mp4">Video type not supported by this browser!</video>

audio tag

For embedding audio into a website.


source tag

used to add source location in picture, audio or video tags.



Link to url/a section of webpage/

<a href="url">link text</a> 
<a href="#yourSection">link text</a>

to open as a new tab:

<a href="url" target="_blanl">link text</a>


Heading 1 - strongest




Heading 2




Heading 3




Heading 4




Heading 5




Heading 6






<em> emphaize </em>

examples: emphaize


<i> italics </i>

examples: italics


<b> bold </b>

examples: bold


<u> underlined </u>

examples: underlined


<strong> strong </strong>

examples: strong



examples: small


<strike> striked text </strike>

examples: striked text


used to break to the next line

<br />

Horizontal Ruler

used to add a horizontal ray as a devidor

<hr />


Forms Tag

container to create HTML forms

<form action="" method="" target=""></form>

inputs Tag

defines input control - depending on the attribute 'type' (covered below)

<input type="" /> 


defines a label for a form element, according to 'for' attribute

<label for=""></label> 


group related elements in a form



defines caption for fieldset tag



specifies list of pre-defined options for an input tag <output></output> used to represent result of a calculation (for using this tag, you will have to use oninput attribute within form tag)

<datalist><option value="">..</option></datalist> 


used to group related options



Text input

Defines single line text input field

<input type="text" /> 

Text input

defines a multiple line input field

<textarea rows="" cols=""></textarea> 

number input

defines numeric input field

<input type="number" /> 

Password - Protected input

Defines password field

<input type="password" /> 

defines dropdown list in the form OR defines an option in the dropdown list

<option value=""></option> 


Defines a clickable button


Checkbox input

Defines a checkbox

<input type="checkbox" /> 

radio input

defines a radio button

<input type="radio" /> 

slider input

slider control

<input type="range" /> 

color input

used for input fields that should contain a color

<input type="color" />

Date input

input field should contain date

<input type="date" /> 

Month input

select month and year

<input type="month" /> 

week input

select week and year

<input type="week" /> 

time input

select time(without timezone)

<input type="time" /> 

Email input

email type input field

<input type="email" /> 

telephone no. input

defines telephone number field

<input type="tel" /> 

link input

url address type input field

<input type="url" /> 

file input

defines file select field and browse button

<input type="file" /> 

image input

upload image

<input type="image" /> 

search bar input

define search field

<input type="search" /> 

reset input

defines a reset button that will reset all form values to their default values

<input type="reset" /> 

submit input

defines button for submitting form data

<input type="submit" /> 


Table elements

used to create a tabular data format

<table></table> - Define a table

<tr></tr> - Define a table row

<th></th> - Define a table heading

<td></td> - Define a table data

Table implementation



Month Savings
January $100
Febuary $200


List elements

<ul></ul> - Defines an unordered list

<ol></ol> - Defines an ordered list

<li></li> - Defines a list item

<dl></dl> - Defines a description list

<dt></dt> - Defines a term in a description list

<dd></dd> - Describes the term in a description list

Unordered List

  <li>Item 1</li>
  <li>Item 2</li>
  <li>Item 3</li>


  • Item 1
  • Item 2
  • Item 3

Ordered List

  <li>Item 1</li>
  <li>Item 2</li>
  <li>Item 3</li>


  1. Item 1
  2. Item 2
  3. Item 3

Scripting Tags

Canvas Tag

Used with either the canvas scripting API or the WebGL API to draw graphics and animations.


noscript tag

Defines a section of HTML to be inserted if a script type on the page is unsupported or if scripting is currently turned off in the browser.




<p style="font-size:48px">&#128512; &#128516; &#128525; &#128151;</p>


😀 😄 😍 💗

With this article at OpenGenus, you must have a strong idea of different HTML tags.

Comprehensive Guide to HTML tags
Share this