CS Engineering Gyan

Introduction to HTML (HyperText Markup Language)

HTML stands for HyperText Markup Language. It is the standard markup language used to create and design the structure of web pages on the Internet.

Every website that we access through a web browser is built using HTML as its basic foundation. HTML defines the arrangement of text, images, links, tables, forms, videos, and other elements displayed on a webpage.

HTML is not a programming language because it does not contain programming logic such as conditions, loops, or calculations. Instead, it is a markup language that uses predefined tags to describe the structure and meaning of web content.

HTML works together with other web technologies such as CSS and JavaScript. HTML creates the structure of a webpage, CSS improves its appearance and design, while JavaScript adds interactivity and dynamic behavior.

What is HTML?

HTML is a markup language that uses a collection of elements called tags to organize and display information on web pages.

A web browser such as Google Chrome, Mozilla Firefox, or Microsoft Edge reads HTML documents and converts them into a visual webpage that users can interact with.

HTML documents are saved using the .html file extension. When a user opens an HTML file in a browser, the browser interprets the HTML tags and displays the content according to the defined structure.

HTML provides different types of tags for creating headings, paragraphs, images, hyperlinks, lists, tables, forms, and many other webpage components.

History of HTML

HTML was created by British computer scientist Sir Tim Berners-Lee in 1991 while working at CERN (European Organization for Nuclear Research).

The main purpose of creating HTML was to provide a simple method for sharing and connecting scientific documents through the Internet.

The first version of HTML contained a limited number of tags that allowed developers to create basic documents with headings, paragraphs, and hyperlinks.

Over time, HTML continued to improve with new features and capabilities. Different versions of HTML were introduced to support modern web development requirements.

Important Versions of HTML

Today, HTML5 is widely used for developing modern websites and web applications because it provides powerful features while maintaining simplicity.

Why HTML is Important?

HTML is the foundation of web development. Without HTML, browsers would not know how to organize and display content on web pages.

HTML provides the basic structure that allows developers to create user-friendly and well-organized websites.

Importance of HTML in Web Development

Features of HTML

HTML provides several important features that make it one of the most widely used technologies for creating websites. Its simple structure and flexible design allow beginners as well as professional developers to build webpages efficiently.

1. Simple and Easy to Learn

HTML has a simple syntax based on predefined tags. Beginners can quickly understand HTML concepts because the structure of HTML documents is easy to read and write.

Unlike complex programming languages, HTML does not require advanced programming knowledge. A student with basic computer knowledge can start creating webpages using HTML.

2. Platform Independent

HTML is a platform-independent technology. HTML documents can run on different operating systems without modification.

A webpage created using HTML can be viewed on operating systems such as Windows, Linux, and macOS using any modern web browser.

3. Open Standard Technology

HTML is an open web standard maintained by international web organizations. Anyone can learn and use HTML without purchasing any license or software.

This availability has helped HTML become the universal language for creating web content.

4. Supports Multimedia Elements

Modern HTML versions provide built-in support for multimedia content such as audio and video.

Developers can add multimedia elements directly into webpages without depending completely on external plugins.

5. Hyperlink Support

The word "HyperText" in HTML represents the ability to connect different webpages using hyperlinks.

HTML links allow users to navigate between different pages, websites, documents, and online resources.

6. Supports Web Page Structure

HTML provides different elements to organize webpage content properly.

Developers can create structured pages using headings, sections, paragraphs, navigation menus, articles, and footer areas.

7. Integration with CSS and JavaScript

HTML works together with CSS and JavaScript to create complete web applications.

HTML Document Structure

Every HTML webpage follows a standard document structure that helps web browsers understand and display the content correctly.

An HTML document consists of different sections such as document declaration, head section, and body section. Each section performs a specific role in creating a complete webpage.

Basic Structure of an HTML Document

<!DOCTYPE html>
<html>
<head>
    <title>My First Web Page</title>
</head>
<body>
    <h1>Welcome to HTML</h1>
    <p>This is my first webpage.</p>
</body>
</html>

Explanation of HTML Structure

A properly structured HTML document improves readability, browser compatibility, and search engine understanding.

Basic Syntax of HTML

HTML uses tags to define different elements of a webpage. These tags tell the browser how the content should be displayed.

Most HTML elements consist of an opening tag, content, and a closing tag.

General HTML Syntax

<tagname>
Content goes here
</tagname>

Example:

<h1>HTML Introduction</h1>

In this example:

HTML tags are written inside angle brackets (< >). The closing tag contains a forward slash (/) before the tag name.

HTML Elements

An HTML element represents a complete component of a webpage. It includes the starting tag, content, and ending tag.

Example of HTML Element:

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

Here, the complete structure from <p> to </p> is called an HTML element.

Main Parts of HTML Element

HTML Tags

HTML tags are predefined keywords enclosed within angle brackets that define the structure and appearance of webpage content.

Each HTML tag performs a specific function. For example, heading tags create headings, paragraph tags create text paragraphs, and image tags display pictures.

Common HTML Tags

HTML Tag Description
<h1> to <h6> Used to create headings of different sizes.
<p> Used to create paragraphs.
<a> Used to create hyperlinks.
<img> Used to display images.
<table> Used to create tables.
<form> Used to create user input forms.
<div> Used to create sections or containers.

Types of HTML Tags

HTML tags are mainly divided into two categories based on their structure and usage.

1. Paired Tags

Paired tags contain both an opening tag and a closing tag. The content is written between these two tags.

Example:

<p>
Welcome to CSE Gyan
</p>

Here, <p> is the opening tag and </p> is the closing tag.

2. Empty Tags

Empty tags do not require a closing tag because they do not contain any content between opening and closing tags.

Examples:

<br>
<hr>
<img src="image.jpg">

Empty tags are used to perform specific actions such as inserting line breaks, horizontal lines, and images.

HTML Attributes

HTML attributes provide additional information about HTML elements. Attributes are written inside the opening tag and modify the behavior or appearance of elements.

Syntax of HTML Attribute

<tag attribute="value">
Content
</tag>

Example:

<a href="https://example.com">
Visit Website
</a>

In this example, href is an attribute that specifies the destination address of the hyperlink.

Common HTML Attributes

First HTML Program

A beginner usually starts learning HTML by creating a simple webpage that displays text content.

Example:

<!DOCTYPE html>
<html>
<head>
<title>My First HTML Page</title>
</head>
<body>
<h1>Welcome to HTML</h1>
<p>
Learning HTML is easy and interesting.
</p>
</body>
</html>

Output:

The browser displays a webpage containing a heading and a paragraph message.

This simple program demonstrates the basic structure and working of an HTML document.

HTML Text Formatting Tags

HTML provides different formatting tags that help developers change the appearance and importance of text displayed on a webpage. These tags improve readability and help users understand important information easily.

Common Text Formatting Tags

Tag Description
<b> Used to display text in bold format.
<i> Used to display text in italic format.
<u> Used to underline text.
<strong> Defines important text with strong importance.
<em> Emphasizes text content.
<mark> Highlights important text.
<small> Displays smaller text.
<sup> Creates superscript text.
<sub> Creates subscript text.

Example:


<p>

<b>HTML</b> is a <i>web technology</i>.

</p>

HTML formatting tags are commonly used in websites to improve content presentation and user experience.

HTML Lists

HTML lists are used to display related information in an organized format. Lists make webpage content easier to read and understand.

HTML provides three main types of lists.

1. Ordered List

An ordered list displays items in a specific sequence using numbers or letters.

Example:

<ol>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ol>

2. Unordered List

An unordered list displays items using bullet points.

Example:

<ul>
<li>Computer Science</li>
<li>Programming</li>
<li>Web Development</li>
</ul>

3. Description List

A description list is used to display terms along with their explanations.

Example:

<dl>
<dt>HTML</dt>
<dd>Markup language for creating webpages.</dd>
</dl>

HTML Tables

HTML tables are used to display data in rows and columns. Tables are commonly used for showing information such as student records, product details, schedules, and comparison data.

Basic Table Structure

<table>
<tr>
<th>Name</th>
<th>Marks</th>
</tr>
<tr>
<td>Rahul</td>
<td>85</td>
</tr>
</table>

Important Table Tags

HTML tables help organize complex information in a structured and understandable format.

HTML Forms

HTML forms are used to collect information from users. Forms allow users to enter data such as names, email addresses, passwords, feedback, and search queries.

Forms are an important part of interactive websites because they provide communication between users and web applications.

Common Form Elements

Example:

<form>
Name:
<input type="text">
Email:
<input type="email">
<button>Submit</button>
</form>

HTML Multimedia Elements

Modern websites often contain multimedia content such as images, audio, and videos. HTML provides built-in elements to add multimedia files directly into webpages.

Image Element


<img src="image.jpg" alt="Website Image">

The image tag is used to display pictures on a webpage.

Audio Element

<audio controls>
<source src="music.mp3">
</audio>

Video Element

<video controls>
<source src="video.mp4">
</video>

Multimedia elements make websites more attractive, interactive, and informative.

Advantages of HTML

HTML provides many benefits that make it the most important technology for creating websites.

Limitations of HTML

Although HTML is an essential technology for web development, it also has some limitations.

HTML vs CSS vs JavaScript

Feature HTML CSS JavaScript
Purpose Creates webpage structure Designs webpage appearance Adds interactivity
Type Markup Language Style Sheet Language Programming Language
Used For Content organization Colors, layout, styling Dynamic behavior
Example Headings and paragraphs Fonts and backgrounds Animations and validation

Conclusion

HTML is the fundamental technology behind the World Wide Web. It provides the basic structure required to create webpages and organize digital content effectively.

Learning HTML is the first step toward becoming a web developer because it builds a strong foundation for learning advanced technologies like CSS, JavaScript, frontend frameworks, and backend development.

With its simple syntax, browser support, and powerful features, HTML continues to remain an essential skill for students, developers, and anyone interested in web technology.

← Previous: Explore All Notes Next: HTML Document Structure →
Home Visit Our YouTube Channel