HTML Introduction

HTML (HyperText Markup Language) is the core language for creating and structuring web pages using tags for text, images, and links.

Advertisement

What is HTML?

HTML (HyperText Markup Language) is the standard language used to create and design webpages and web applications. HTML describes the structure of a webpage using elements, which are represented by tags.

HTML Document Structure

A standard HTML page has a consistent structure that every webpage follows. The main sections are:

  • <!DOCTYPE html> – Declares the document type (HTML5).
  • <html> – Root element of the page.
  • <head> – Contains metadata, title, and links to stylesheets or scripts.
  • <body> – Contains all visible content like headings, paragraphs, links, images, and videos.
HTML
▶ Run it
<!-- A basic HTML page -->
<!DOCTYPE html>
<html>
<head>
  <title>Page Title</title>
</head>
<body>

  <h1>Hello World</h1>
  <p>This is my first HTML page.</p>

</body>
</html>

How HTML Works: Understanding Step-by-Step

Step 1: Start with the Document Type

Every HTML page begins with <!DOCTYPE html> to tell the browser to use HTML5.

<!DOCTYPE html>

Step 2: Create the HTML Root Element

All content goes inside the <html> element.

<html>
    <!-- Content goes here -->
</html>

Step 3: Add Head and Metadata

The <head> section contains metadata like the page title.

<head>
    <title>My First Page</title>
</head>

Step 4: Add the Body

The <body> section contains visible content like headings, paragraphs, and links.

<body>
    <h1>Welcome to My Website</h1>
    <p>This is my first HTML page.</p>
</body>

Step 5: Complete HTML Page Example

<!DOCTYPE html>
<html>
<head>
    <title>My First Page</title>
</head>
<body>
    <h1>Hello World!</h1>
    <p>This is a simple HTML page.</p>
</body>
</html>

Why Learn HTML?

  • Foundation of Web Development: All websites are built with HTML.
  • Easy to Learn: HTML has a simple syntax for beginners.
  • Works with CSS & JavaScript: HTML structures content, CSS styles it, and JS adds behavior.
← Previous Next →