HTML Introduction
What is HTML with example ?
HTML stands for Hypertext Markup Language. It is a markup language used for creating web pages and other documents that can be displayed in a web browser. HTML consists of a series of elements, which are enclosed in angle brackets (< >), and provide structure and meaning to the content they contain.
Here is an example of a simple HTML document:
My Webpage
Welcome to My Webpage
This is an example of a paragraph.
- Item 1
- Item 2
- Item 3
Output
Welcome to My Webpage
This is an example of a paragraph.
- Item 1
- Item 2
- Item 3
In this example, the <!DOCTYPE html>
declaration specifies the document type, and the <html>
element defines the start and end of the HTML document. The <head>
element contains metadata about the document, such as the title, and is not displayed on the web page itself. The <body>
element contains the main content of the web page, which in this case includes a heading (<h1>
), a paragraph (<p>
), and an unordered list (<ul>
). Each list item in the unordered list is represented by the <li>
element.
Where is HTML used?
HTML is used in creating web pages and other documents that can be displayed in a web browser. It is the foundation of most websites and is used to structure and format the content on a web page.
HTML is used in a variety of contexts, including:
-
Websites: HTML is the primary language used to create web pages and websites.
-
Emails: HTML is used to format and style the content of emails, such as newsletters or promotional messages.
-
Web applications: Many web applications use HTML to structure and display information to users.
-
E-commerce platforms: HTML is used to create product listings, shopping carts, and checkout processes on e-commerce websites.
-
Online documents: HTML can be used to create online documents such as user manuals, help files, and technical documentation.
In summary, HTML is used in any context where there is a need to display content on the web, and is an essential skill for anyone involved in web design or development.
HTML page structure
The basic structure of an HTML page consists of several elements, including:
-
<!DOCTYPE html>
declaration: This declares the document type and ensures that the browser will render the page correctly. -
<html>
element: This is the root element of the HTML page and contains all other elements. -
<head>
element: This element contains metadata about the document, such as the title, keywords, and description, and may also contain links to external stylesheets, scripts, and other resources. -
<body>
element: This element contains the main content of the web page, such as text, images, and other media.
Here’s an example of what the basic structure of an HTML page might look like:
My Webpage
Welcome to My Webpage
Introduction
This is the main content of my webpage.
Output
Welcome to My Webpage
Introduction
This is the main content of my webpage.

In this example, the <html>
element contains the <head>
and <body>
elements. The <head>
element contains the page’s title, description, and a link to an external stylesheet. The <body>
element contains the main content of the page, including a header, main content area, and a footer. The header includes a navigation menu, while the main content area includes text and an image. The footer includes copyright information. Finally, the <script>
tag includes a reference to an external JavaScript file.
HTML stands for Hypertext Markup Language. It is a markup language used for creating web pages and other documents that can be displayed in a web browser. HTML consists of a series of elements, which are enclosed in angle brackets (< >), and provide structure and meaning to the content they contain.
Here is an example of a simple HTML document:
HTML tags with example
HTML tags are used to create elements that define the structure and content of a web page. Here are some common HTML tags with examples of how they are used:
<h1>
–<h6>
tags: These tags are used to create headings of varying sizes, with<h1>
being the largest and<h6>
being the smallest. Example:
This is a Heading 1
This is a Heading 2
This is a Heading 3
<p>
tag: This tag is used to create paragraphs of text. Example:
This is a paragraph of text.
<a>
tag: This tag is used to create hyperlinks to other web pages or resources. Example:
HTML attributes
HTML attributes are used to provide additional information about HTML elements. They are used to customize the behavior and appearance of HTML elements. Here are some common HTML attributes with examples:
id
attribute: This attribute is used to give an element a unique identifier. Example:
class
attribute: This attribute is used to assign a class name to an element, which can be used for styling or JavaScript interactions. Example:
This text is important
src
attribute: This attribute is used to specify the URL of an image or other external resource that is to be displayed in an HTML element. Example:
href
attribute: This attribute is used to specify the URL of a link in an anchor (<a>
) element. Example:
title
attribute: This attribute is used to provide additional information about an element when a user hovers over it with their mouse. Example:
target
attribute: This attribute is used to specify whether a link should open in the same or a new browser window or tab. Example:
HTML elements with example
HTML elements are the building blocks of a web page, made up of one or more HTML tags. Here are some common HTML elements with examples:
<header>
element: This element is used to define the header section of a web page, typically containing a logo, navigation menu, or other site-wide information. Example:
<main>
element: This element is used to define the main content of a web page, excluding the header, footer, and other secondary content. Example:
Welcome to my website
This is the main content of my web page.
<footer>
element: This element is used to define the footer section of a web page, typically containing copyright information, contact details, or other site-wide information. Example:
<form>
element: This element is used to create a form on a web page for user input. Example:
<video>
and<audio>
elements: These elements are used to embed video and audio content on a web page. Example:
HTML language stats and facts
Here are some interesting statistics and facts about HTML:
HTML (Hypertext Markup Language) was first created by Tim Berners-Lee in 1991 while working at CERN, the European Organization for Nuclear Research.
HTML is the standard markup language used to create web pages.
HTML5 is the current version of HTML, and it was released in 2014.
HTML5 introduced many new features and elements, including the
<video>
and<audio>
elements for embedding multimedia content directly in web pages.According to W3Techs, as of September 2021, HTML is used by 96.7% of all websites.
HTML is used in conjunction with other web technologies, such as CSS (Cascading Style Sheets) for styling web pages and JavaScript for adding interactivity.
HTML is a markup language, not a programming language. It is used to structure content and provide context to web browsers, which then render the content for display to the user.
HTML is an open standard, which means that it is maintained and developed by a community of volunteers and experts from around the world.
HTML has many semantic elements that can be used to provide meaning and context to the content of web pages, making them more accessible to people using assistive technologies such as screen readers.
HTML can be learned by anyone with an interest in web development. There are many resources available online for learning HTML, including tutorials, documentation, and online courses.