Lesson 1: What Is HTML and How Does It Work?

In this module, we’ll focus on HTML, the foundation of every website. HTML (HyperText Markup Language) uses elements (tags) to define the structure and content of a webpage. By the end of this module, you’ll be able to create well-structured and meaningful webpages.


HTML Basics

  • HTML files are plain text files saved with the extension .html.
  • Browsers read and interpret HTML to display content.

HTML Syntax

HTML uses tags enclosed in angle brackets (< >). Tags often come in pairs:

  • Opening tag: <p>
  • Closing tag: </p>

Example:

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

The Basic Structure of an HTML Document

Every HTML document has a standard structure:

<!DOCTYPE html> <!-- Specifies the document type -->
<html> <!-- Root element -->
  <head> <!-- Contains metadata (not visible on the webpage) -->
    <title>My Webpage</title> <!-- Sets the page title -->
  </head>
  <body> <!-- Contains visible content -->
    <h1>Hello, World!</h1>
    <p>Welcome to my first webpage!</p>
  </body>
</html>