HTML

What is HTML?

HTML stands for HyperText Markup Language. It is the backbone of every website on the internet. HTML is used to structure web pages and define the meaning of content such as headings, paragraphs, images, links, tables, and more.

Every website you see—whether it is a blog, e-commerce store, portfolio, or social media platform—is built using HTML as the foundation.

HTML is not a programming language; it is a markup language. This means it tells the browser how content should be displayed.

Why Learn HTML?

Learning HTML is the first step in becoming a web developer. It provides the basic structure for all websites.

Key Benefits:
  • Easy to learn for beginners
  • Forms the foundation of web development
  • Works with CSS and JavaScript
  • Required for frontend and backend development
  • Helps in building real-world projects

Basic Structure of HTML

Every HTML page follows a basic structure:

<!DOCTYPE html>
<html>
<head>
<title>My First Web Page</title>
</head>
<body>

<h1>Welcome to HTML Course</h1>
<p>This is a simple paragraph.</p>

</body>
</html>

HTML Elements

HTML is made up of elements. Each element has a tag

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

Common Elements:
  • Headings: <h1> to <h6>
  • Paragraph: <p>
  • Link: <a>
  • Image: <img>
  • Division: <div>
  • Span: <span>

HTML Headings

Headings are used to define titles and subtitles.

<h1>Main Heading</h1>
<h2>Sub Heading</h2>
<h3>Section Heading</h3>
 

Note:

  • <h1> is the largest heading
  • <h6> is the smallest heading

Paragraphs and Text Formatting

HTML allows you to format text easily.

Example:

<p>This is a paragraph.</p>
<b>Bold Text</b>
<i>Italic Text</i>
<u>Underlined Text</u>

Other Formatting Tags:
  • <strong> → Important text
  • <em> → Emphasized text
  • <br> → Line break

Links in HTML

Links connect one page to another.

<a href=”https://example.com”>Visit Website</a>
Types of Links:
  • Internal links (within website)
  • External links (other websites)
  • Email links

Images in HTML

Images make websites attractive.

<img src=”image.jpg” alt=”Sample Image” width=”300″>
Attributes:
  • src → image path
  • alt → alternate text
  • width → size control

HTML Best Practices

  • Use proper indentation
  • Always close tags
  • Use meaningful names
  • Add alt text to images
  • Keep code clean and readable