Understanding HTML Basics and Structure

Sep 17, 2024

Introduction to HTML

What is HTML?

  • HTML stands for Hypertext Markup Language.
  • It is not a programming language but a markup language.
  • It provides structure to a web page.
  • It uses tags to instruct web browsers like Chrome, Safari, or Edge.

Structure of an HTML Document

  • HTML organizes a page using headings and subheadings.
  • The structure helps in understanding the content of the document.
  • HTML Elements:
    • Shown in red with angle brackets in the code.
    • Typically have an opening and closing tag.
    • Closing tags have a slash after the first angle bracket (e.g., </tag>).
    • Some tags can contain other tags, forming nested or parent-child relationships.

Common HTML Elements

  • <h1>: Main heading
  • <h2>: Subheading (one level below <h1>)
  • <p>: Paragraph text

Hypertext and Markup

  • Hypertext: Allows placement of links enabling navigation from one page to another.
  • Markup: Set of symbols or codes for displaying internet content.

HTML Document Structure

  • Basic HTML framework consists of nested elements.
  • HTML tag:
    • Container for all other HTML tags.

Key HTML Tags

  • <!DOCTYPE html>: Document Type Declaration indicating HTML version 5.
  • <html>: Root element containing all other HTML elements.
  • <head>:
    • Contains elements about the page.
    • Includes a <title> element for the browser's title bar or tab.
  • <body>:
    • Contains all elements that will display on the page.

Creating HTML Files

  • HTML files can be created using any simple text editor.
  • Code editors are available for easier coding.

Viewing HTML

  • The HTML structure can be seen by viewing the source of any web page.