HTML Introduction

Subject: html

HTML (HyperText Markup Language) is the standard language used to create and structure content on the web. It forms the foundation of every website you visit and defines the basic layout and components of web pages. Unlike programming languages such as JavaScript or Python, HTML is a markup language—it doesn’t perform logic or computations but instead organizes and labels content so that browsers can display it properly.

The term "HyperText" refers to text linked via hyperlinks, allowing users to navigate between web pages. "Markup" refers to the tags and elements used to define content, such as headings, paragraphs, lists, images, links, and forms.

The Role of HTML in Web Development

HTML plays a structural role in web development. Think of it as the blueprint of a web page. It is responsible for:

  • Defining the layout and structure of content (e.g., headings, paragraphs, lists)
  • Linking to documents and resources such as images, stylesheets, and scripts
  • Providing semantic meaning for better accessibility and SEO
  • Enabling user input via forms, checkboxes, buttons, and input fields
  • Integrating multimedia content like videos, audio, and embedded elements

While HTML doesn’t handle visual styling (that's CSS) or interactivity (that's JavaScript), it is the core structure upon which everything else is built.

Basic Structure of an HTML Document

Explanation

  • <!DOCTYPE html>: Declares the document type and version as HTML5.
  • <html lang="en">: Sets the document's language to English and defines the root of the HTML.
  • <head>: Contains metadata, links, and browser configuration (not visible content).
  • <meta charset="UTF-8">: Sets the character encoding to UTF-8 for wide character support.
  • <meta name="viewport"...>: Makes the page responsive on different screen sizes.
  • <title>: Specifies the title of the page shown in the browser tab.
  • <body>: Contains all the content that appears on the web page.
  • <h1>: Displays the main heading of the page.
  • <p>: Represents a block of paragraph text.