Logo OnlineCBT
HTML Tutorial
HTML · LESSON 1

Introduction to HTML and the Web

Understand the purpose of HTML, how web browsers parse documents, and how modern websites work.

Level: Beginner to Advanced
Duration: ~60 Mins Deep-Dive
Updated: 29 Jul 2026

Introduction to HTML and the Web

1. Understanding the Web

Before writing single lines of code, developers must understand the foundational infrastructure that powers digital pages. The terms The Internet and The World Wide Web (WWW) are commonly used interchangeably, but they represent two distinct systems working together.

Concept Definition Analogy
The Internet A global physical network of interconnected hardware including servers, routers, fiber-optic cables, and wireless systems. The physical highway and road network of a nation.
The World Wide Web An information-sharing system built on top of the Internet that allows documents and resources to be accessed using HTTP/HTTPS protocols. The delivery trucks and vehicles traveling along the network to transport goods.

Core Web Concepts Every Developer Should Know

  • Web Client (Browser): Software application (e.g., Google Chrome, Mozilla Firefox, Apple Safari) that requests web documents, parses HTML/CSS/JavaScript code, and renders visual interfaces for end users.
  • Web Server: A specialized computer system connected to the Internet 24/7 that stores website assets (HTML pages, stylesheets, scripts, media files) and listens for incoming request packets.
  • IP Address (Internet Protocol Address): A unique numerical identifier (e.g., 192.0.2.1 or IPv6 address) assigned to every device on a network to route data accurately.
  • DNS (Domain Name System): The automated directory service of the Internet that translates human-readable web addresses (e.g., www.google.com) into system-routable IP addresses.
  • HTTP / HTTPS: HyperText Transfer Protocol (and its encrypted variant HTTPS) defines the structured message rules used by clients and servers to exchange web assets.

2. The Request-Response Cycle

When an end user enters a website URL into a browser address bar and presses Enter, a structured multi-step communication sequence executes within milliseconds.

How the Browser Obtains Web Pages:
  1. Domain Resolution: The browser queries a Domain Name System (DNS) server to find the IP address corresponding to the entered domain name.
  2. TCP/IP Connection Establishment: The client establishes a secure socket connection with the target server at the retrieved IP address.
  3. HTTP GET Request: The browser transmits an HTTP request packet requesting the document payload located at the target path.
  4. Server Payload Processing: The web server processes the request, locates the required HTML document, and responds with an HTTP status code (e.g., 200 OK) along with the raw source code.
  5. Resource Parsing & Rendering: The browser reads the received HTML from top to bottom, initiating additional asynchronous requests for linked stylesheets, scripts, and image assets.

3. What is HTML?

HTML stands for HyperText Markup Language. It is not a standard programming language containing logical loops or conditional algorithms; rather, it is a declarative markup language used to structure web content.

  • HyperText: Text containing embedded structural links that allow users to navigate seamlessly between different documents across the web.
  • Markup Language: A standardized system of tags used to annotate plain text, indicating how web browsers should interpret and present content.

The Three Pillars of Front-End Web Development

Layer Technology Primary Responsibility
Structure HTML5 Defines document hierarchy, textual content, semantic elements, and embedded assets.
Presentation CSS3 Controls visual formatting, colors, responsive grid layouts, animations, and typography.
Behavior JavaScript Manages dynamic interactivity, asynchronous data fetching (API requests), and client logic.

4. Anatomy of an HTML Element

HTML documents are constructed using structural building blocks called Elements. Most elements consist of an opening tag, optional attributes, content, and a closing tag.


This is the text content inside the element.

Element Components Explained

  • Opening Tag (

    ): Enclosed in angle brackets, this specifies where the element starts and defines its type.

  • Attributes (class="..." id="..."): Name-value pairs located inside the opening tag that provide metadata, unique identifiers, or styling targets.
  • Enclosed Content: The text, media, or nested child elements positioned between the opening and closing tags.
  • Closing Tag (

    ):
    Mirroring the opening tag with a forward slash (/), this marks the termination of the element.

Void Elements (Self-Closing): Some structural HTML elements cannot contain text or nested nodes. These are termed void elements and do not use a closing tag. Examples include , , , , and
.

5. Standard HTML5 Document Boilerplate

Every standard-compliant web page requires a defined structural template to ensure cross-browser consistency and responsive mobile behavior.




    
    
    Introduction to Web Architecture


    

Welcome to Web Development

This standard boilerplate ensures modern rendering standards across all browsers.

Line-by-Line Document Breakdown

  • : Mandatory preamble that instructs the browser to render the document using modern HTML5 standard mode rather than legacy Quirks mode.
  • : The root wrapper element for the entire page. The lang attribute assists search engines and screen-reader accessibility software.
  • : Container for document metadata, character sets, document title, and links to external CSS stylesheets or scripts. Content inside is not directly visible on the viewport.
  • : Declares the UTF-8 character encoding, ensuring correct display of global alphabets, mathematical symbols, and special characters.
  • : Configures the browser viewport width to match the physical device width, enabling responsive mobile design.
  • : The structural container holding all visible page elements including headings, paragraphs, lists, forms, images, and visual components.

6. Homework Assignments & Practical Exercises

Task 1: Creating Your First HTML Page (Current Lesson)

Construct a standalone file named index.html containing a valid HTML5 boilerplate layout. Set the document title to "Developer Portfolio", add a primary heading (

) with your name, and write two structured paragraphs detailing your web development goals.

Task 2: Element Identification & Void Tags (Current Lesson)

Add a profile image element () and a line break (
) into your HTML file. Inside an HTML comment block (), explain why void tags do not require a closing slash in modern HTML5 specifications.

Task 3: Comprehensive Client-Server Revision (All-Inclusive Task)

Draw or write a structured 5-step outline explaining the complete lifecycle of a web request. Detail the exact roles played by the Browser (Client), DNS Server, IP Addressing, HTTP Methods, and Web Server when fetching an HTML document.

7. Frequently Asked Interview Questions

Q1: What is the exact function of in modern web applications?

Answer: The declaration tells the browser engine to parse the page using the strict HTML5 standard mode. Without this declaration, web browsers may render the page in "Quirks Mode", leading to inconsistent layout behavior and outdated CSS box model rendering.

Q2: How do HTML tags differ from HTML elements?

Answer: An HTML Tag refers specifically to the syntax enclosed in angle brackets used to mark boundaries (e.g.,

or

). An HTML Element encompasses the complete unit, including the opening tag, attributes, contained text content or nested nodes, and the closing tag.

Q3: Why is character encoding () recommended for every web page?

Answer: UTF-8 covers almost all characters, symbols, and alphabets worldwide. Specifying UTF-8 prevents character corruption (mojibake) when displaying international text, emojis, or specialized symbols across different operating systems and browser engines.

Q4: What happens during a DNS lookup during web navigation?

Answer: A DNS lookup translates human-readable domain names (e.g., example.com) into machine-routable IP addresses (e.g., 93.184.216.34). This allows the browser client to route TCP packets directly to the correct hosting web server across the physical internet infrastructure.

Lesson 02 Preview: History of HTML and HTML5

Now that you understand basic web infrastructure and HTML boilerplate construction, our next lesson explores how markup languages evolved over three decades:

  • The Early Days (1991): Tim Berners-Lee creates the initial 18-tag HTML specification at CERN.
  • The Standards War & XHTML: The transition through HTML 2.0, 3.2, 4.01, and the strict XML rules of XHTML 1.0.
  • The HTML5 Standard: How WHATWG and W3C modernized the web with semantic elements (
    ,
    ,

📝 Live Lesson Practice

HTML/CSS JavaScript Python C++ C PHP
⌨️ Practice Inputs (लाइव इनपुट भरें) (खाली होने पर RED, भरने पर GREEN underline)
💻 Code Editor (Monaco VS Code Engine)
👀 Live Preview
Address Contact

+91 7877547686

E-mail

onlinecbtportal@gmail.com

Helpline Number

+91 7877547686


Click To Download
Get it on Google Play

ऐप डाउनलोड करने
के लिए Google Play पर
उपलब्ध है

WhatsApp Chat