HTML Introduction

Understanding the foundation of web development

🌐 What is HTML?

HTML (HyperText Markup Language) is the standard markup language for creating web pages. It describes the structure of web pages using markup tags and elements.


<!-- This is a simple HTML example -->
<h1>Welcome to HTML!</h1>
<p>HTML is easy to learn.</p>
                                    

Output:

Welcome to HTML!

HTML is easy to learn.

Key HTML Concepts

🏷️

Tags

HTML uses tags to mark up content

<h1>This is a heading</h1>
🧩

Elements

Tags create elements with content

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

Structure

HTML provides document structure

<html>
  <head></head>
  <body></body>
</html>
🔗

Links

Connect pages together

<a href="page.html">Click here</a>

🔹 HTML Document Structure

Every HTML document has a basic structure:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Page Title</title>
</head>
<body>
    <h1>My First Heading</h1>
    <p>My first paragraph.</p>
</body>
</html>

Output:

My First Heading

My first paragraph.

🔹 HTML Tags Explained

HTML tags are keywords surrounded by angle brackets:

<!-- Opening tag -->
<h1>

<!-- Content -->
Hello World

<!-- Closing tag -->
</h1>

<!-- Complete element -->
<h1>Hello World</h1>

Output:

Hello World

🔹 Common HTML Elements

Here are some basic HTML elements you'll use frequently:

<!-- Headings -->
<h1>Main Title</h1>
<h2>Subtitle</h2>

<!-- Paragraph -->
<p>This is a paragraph of text.</p>

<!-- Link -->
<a href="https://example.com">Visit Example</a>

<!-- Image -->
<img src="image.jpg" alt="Description">

<!-- Line break -->
<br>

Output:

Main Title

Subtitle

This is a paragraph of text.

Visit Example

Image

🧠 Test Your Knowledge

What does HTML stand for?