Lesson 1: Introduction to HTML

Objective

By the end of this lesson, you’ll understand:

  • What HTML is.
  • Why it’s important.
  • How to create a basic HTML document.

What is HTML?

HTML (HyperText Markup Language) is the standard language for creating web pages. It structures the content on the web, using elements like text, images, and links.


Why Learn HTML?

  • It’s the foundation of web development.
  • It’s beginner-friendly and easy to learn.
  • It allows you to build and customize websites.

Basic HTML Structure

An HTML document is made up of elements. Here’s the structure:

<!DOCTYPE html>
<html>
  <head>
    <title>My Page</title>
  </head>
  <body>
    <h1>Hello, World!</h1>
  </body>
</html>


Explanation

  1. <!DOCTYPE html>: Tells the browser this is an HTML5 document.
  2. <html>: The root element containing all HTML code.
  3. <head>: Contains metadata and the title of the page.
  4. <title>: Sets the page title visible in the browser tab.
  5. <body>: Holds the main content of the page.
  6. <h1>: Represents the main heading.
  7. <p>: Represents a paragraph.

Activity

  1. Open a text editor (e.g., Notepad on Windows, TextEdit on Mac, or Visual Studio Code).
  2. Copy the example code above and save it as index.html.
  3. Open the file in a browser to see your first web page.

Quiz

  1. What does <!DOCTYPE html> do?
    • a) Displays the page title.
    • b) Tells the browser the HTML version.
    • c) Adds a paragraph.
    • d) Styles the content.

Summary

  • HTML is the backbone of web pages.
  • The structure includes elements like <html>, <head>, and <body>.
  • You can create your first web page with just a few lines of code.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *