🎯 Lesson Goal: Understand the client-server architecture of the web, the request journey from typing a URL to rendering in the browser, the difference between static and dynamic websites, and learn to inspect fundamental network requests in the DevTools Network panel.
📚 Prerequisites: No prior knowledge required — this is the introductory lesson of the course.

Before writing your first tag, it is helpful to understand what happens when you type a website address and press Enter. In fractions of a second, the browser finds the right computer on the internet, requests its files, and turns the received text into an interactive page. This knowledge is essential from day one: you will understand why a page fails to load, where a 404 error comes from, and which part of the site you are responsible for as a front-end developer.

1. Theory

Client and Server

The web operates on a client-server model. A client is an application that requests data; for websites, this is a browser: Chrome, Firefox, Safari, Edge. A server is a computer connected to the internet around the clock that stores website files and delivers them upon request; typically, it is a specialized Linux server hosted in a data center.

Key takeaway: websites live on the server, not on the user's device. The browser downloads a copy of the page, displays it, and saves certain assets to the local cache to load faster on subsequent visits. If the owner updates a file on the server, every visitor sees the new version. But if you modify the page locally in your browser inspector, only you see those changes and only until you refresh the tab — we will explore this hands-on in the DevTools lesson.

The Journey of a Request: From Address to Page

Let's walk step-by-step through what happens after entering https://prowid.com/courses/htmlcss?lang=ru.

Step 1. The Browser Parses the Address

A URL (Uniform Resource Locator) is the complete web address of an online resource. The browser decomposes it into structural components:

PartIn our addressWhat it represents
Protocolhttps://The communication rules between client and server
Domainprowid.comThe human-readable name used to locate the server
Path/courses/htmlcssThe specific page or file requested on the server
Parameters?lang=ruExtra query parameters, an optional component

Step 2. DNS: Translating Names to IP Addresses

Computers communicate using numeric IP addresses like 203.0.113.25, not alphabetical names. Because numbers are difficult for humans to remember, the DNS (Domain Name System) acts as the distributed "phone book" of the internet. The browser queries a DNS server for the domain's corresponding IP address before attempting to connect:

text
Browser → DNS Server:    What is the IP address of prowid.com?
DNS Server → Browser:    prowid.com = 203.0.113.25
Browser → 203.0.113.25:  Opening secure connection (HTTPS, port 443)

DNS responses are cached locally on your device and by your ISP, making repeated requests virtually instantaneous.

💻 Terminal Command: You can discover the underlying IP address of any domain using the built-in nslookup command-line tool. Open your terminal (PowerShell / Command Prompt on Windows, Terminal on macOS/Linux) and run:

Linux / Bash
nslookup prowid.com

The terminal will output the responding DNS server and an Address: line displaying the actual IP address of the site.

Step 3. The HTTP Request

Once the network connection is established, the browser sends an HTTP request — a structured plain-text message following the HTTP (HyperText Transfer Protocol) standard:

text
GET /courses/htmlcss?lang=ru HTTP/1.1
Host: prowid.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/140.0
Accept: text/html
Accept-Language: ru,az;q=0.9,en;q=0.8

The first line is crucial: the method GET ("retrieve this resource"), the target path, and the protocol version. Below it follow the headers — metadata specifying the target host (Host), the browser software (User-Agent), and acceptable formats (Accept) and languages.

Step 4. The HTTP Response

The server locates the file on disk (or generates it dynamically via program code) and sends back a response: a status line, metadata headers, and the body — the actual document payload.

text
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Content-Length: 412
Cache-Control: max-age=600

(blank line separating headers from body)

The response body contains the raw HTML markup. Here is what a simple server-returned document looks like:

html
<h1>HTML and CSS course</h1>
<p>Start: 1 October, Baku. Duration: 4 months.</p>
Result

💡 Please note: We look at this HTML code right now purely as raw text transmitted from server to browser. We will begin formally studying HTML tags in lesson 003. What matters right now is understanding this core concept: the server transmits text, and the browser transforms it into a visual page. The Content-Type: text/html header instructs the browser: "This is HTML, render it". If the server had sent Content-Type: text/plain, the browser would display raw code with angle brackets like a text editor.

Step 5. Downloading Secondary Resources and Rendering

As the browser reads the HTML document from top to bottom, it discovers references to external assets: CSS stylesheets, JavaScript files, images, and custom web fonts. For each external file, the browser issues an independent HTTP request — loading a modern webpage commonly requires dozens or hundreds of requests.

Once the resources are gathered, the browser constructs the document object model (DOM), applies visual rules (CSS), calculates layout dimensions, and paints the final pixels onto your display.

HTTP Status Codes

Every HTTP response begins with a 3-digit status code. The first digit specifies the general category:

  • 2xx (Success): The request was received and processed successfully.
  • 3xx (Redirection): Further action needed; the resource has relocated.
  • 4xx (Client Error): The request contains bad syntax or targets an invalid URL.
  • 5xx (Server Error): The server failed to fulfill an apparently valid request.
CodeNameTypical Scenario
200OKStandard response for successful HTTP requests
301Moved PermanentlyThe resource has permanently relocated; browsers auto-redirect to the new URL (e.g. from http:// to https://)
304Not ModifiedThe cached copy is fresh; the browser reuses local assets, saving bandwidth
404Not FoundThe server cannot locate the requested path: typo in URL or deleted page
500Internal Server ErrorUnhandled server-side exception; the fault lies with the hosting server, not the user

A custom "404" page is also just an HTML document. The server returns status code 404 along with a friendly page so visitors understand what happened:

html
<h1>404</h1>
<p>Page not found. Check the address.</p>
Result

HTTPS: Why the Lock Icon Matters

Standard HTTP transmits packets in plain text. Any network intermediary (such as public Wi-Fi hotspots or internet providers) can inspect or manipulate your data.

HTTPS (HTTP Secure) runs HTTP inside an encrypted TLS (Transport Layer Security) session. It provides three guarantees:

  1. Privacy (Encryption): Passwords, credit cards, and session tokens cannot be read in transit.
  2. Authentication: Digital certificates verify that you are communicating with the authentic prowid.com server and not an imposter.
  3. Data Integrity: Network tamperers cannot inject unwanted advertisements or malicious scripts into the page.

Today, HTTPS is an essential global baseline: modern browsers mark unencrypted HTTP websites as "Not Secure", and sensitive browser APIs (camera, microphone, geolocation) are blocked without HTTPS.

⚠️ The padlock icon only guarantees that the connection is securely encrypted. It does not prove that a website owner is reputable: malicious actors can also obtain free SSL certificates for phishing sites. Always verify the domain name in the address bar.

HTML, CSS and JavaScript: The Three Layers of the Web

Every webpage is crafted from three core technologies, each with a distinct separation of concerns:

TechnologyRoleConstruction Analogy
HTMLSkeleton and semantics: headings, paragraphs, links, buttons, inputsFoundations and load-bearing walls
CSSPresentation: colors, typography, spacing, layout grids, responsivenessExterior facade, paint, interior design
JavaScriptInteractivity and behavior: click handling, animations, dynamic data fetchingElectrical wiring, elevators, automatic sliding doors

Let's look at an example course card:

  1. HTML only: The browser applies default browser typography and styling. The structure is clear and readable, but looks like an unstyled text document:
html
<article>
  <h2>HTML and CSS</h2>
  <p>Build websites from scratch: 4 months, Baku.</p>
  <button>Sign up</button>
</article>
Result
  1. Adding CSS styling: The HTML markup remains completely unchanged, but the visual appearance transforms:
html
<style>
  article {
    max-width: 300px;
    padding: 20px;
    border-radius: 16px;
    background: linear-gradient(135deg, #eef2ff, #e0f2fe);
    box-shadow: 0 4px 12px rgb(0 0 0 / 0.1);
  }
  h2 { margin: 0 0 8px; color: #4338ca; }
  button {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    color: #fff;
    background: #4f46e5;
  }
</style>

<article>
  <h2>HTML and CSS</h2>
  <p>Build websites from scratch: 4 months, Baku.</p>
  <button>Sign up</button>
</article>
Result

💡 Showcase: The styling code in the <style> block above is presented exclusively for visual comparison. We will begin learning HTML markup in lesson 003 and CSS properties in lesson 039. Students do not need to memorize or write this code right now.

  1. JavaScript adds behavior: For instance, updating button text upon click:
js
// locate button element
const button = document.querySelector('button');

// update text on click
button.addEventListener('click', () => {
  button.textContent = 'You are signed up!';
});

Domains, Web Hosting and Static Sites

  • Domain — The memorable alphabetical address of a website (prowid.com, google.com). You register a domain through an accredited registrar (typically for 1-year terms).
  • Web Hosting — The remote server computer with disk space and persistent internet connectivity where your website files are stored.
  • DNS Resolution: To point a domain to a server, you add a DNS record (an A record) in your domain registrar control panel pointing to the hosting server's public IP address.

Static Website — A collection of pre-built files (HTML, CSS, JS, images) served directly to the browser without server-side calculation. They are blazing fast, reliable, and secure. You can host them for free on platforms like GitHub Pages, Cloudflare Pages, or Netlify.

Dynamic Website — Pages generated dynamically on the fly by server-side runtime code (PHP, Node.js, Python) communicating with databases (such as e-commerce stores, user dashboards, or social platforms).

A typical static site file structure:

text
my-site/
├── index.html      ← Default homepage
├── about.html      ← "About Us" page (https://my-site.com/about.html)
├── css/
│   └── style.css   ← Stylesheet
└── images/
    └── logo.svg    ← Graphics and media

The file index.html is special: almost all web servers serve it automatically when a directory URL is requested.

See It With Your Own Eyes: The Network Panel

You can inspect all real-world HTTP traffic inside the built-in browser DevTools:

  1. Open any website in your browser and press F12 (or Cmd + Option + I on macOS).
  2. Switch to the Network panel tab.
  3. Refresh the page (Ctrl + R or Cmd + R) — the table will populate with live network requests.
  4. Click on the topmost request row with type document — this is the main HTML document.
  5. In the Headers sub-tab, inspect the Status Code and Content-Type. In the Response sub-tab, inspect the raw HTML text sent by the server.

The network inspection table looks like this:

text
Name         Status   Type         Size      Time
htmlcss      200      document     14.2 kB   120 ms
style.css    200      stylesheet    8.1 kB    35 ms
main.js      200      script        5.4 kB    41 ms
logo.svg     200      svg+xml       2.3 kB    22 ms
promo.png    404      png           0.6 kB    18 ms

💡 Enabling Disable cache inside DevTools ensures your browser always requests fresh files from the server, preventing stale CSS caching issues during active development.


2. Deep Dive: HTTP Lifecycle & SEO Impact of Status Codes

DNS Caching and TTL

Every DNS record carries a TTL (Time To Live, in seconds). TTL specifies how long resolvers and local computers may cache the IP address before making another DNS request.

  • If TTL is set to 3600 (1 hour), migrating your website to a new server IP address can leave some users accessing the legacy server for up to an hour.
  • Before planned server migrations, experienced administrators lower the TTL to a few minutes.

The Dangers of "Soft 404" Errors

A frequent mistake made by beginners is returning a custom "Page Not Found" HTML layout while inadvertently serving an HTTP status code of 200 OK.

This mistake is termed a Soft 404:

  1. Search engine crawlers (Googlebot) interpret status code 200 OK as a legitimate, indexed page. Search indexes become bloated with ghost pages, hurting site rank.
  2. Caching proxies store the error page as valid content.

Golden web standard rule: If a requested resource does not exist, the server must return status code 404.


Security & Best Practices

  1. Avoid Plain HTTP: Never submit credentials or confidential information over http://. Unencrypted traffic is readable by anyone on the local network path.
  2. Beware Mixed Content: When serving an HTTPS page, attempting to load images or scripts via unencrypted http:// URLs triggers browser security blocks. Use protocol-relative or https:// URLs for all assets.
  3. Phishing Awareness: SSL certificates verify encryption, not company legitimacy. Always verify domain spellings (e.g. prowid.com vs prow1d.com).

Common Beginner Pitfalls

  • "Websites live on the user's computer": No, users only hold a temporary cache. Edits must be deployed to the host server for public visibility.
  • "HTML is a programming language": HTML is a markup language. It defines document hierarchy and meaning without arithmetic, logic, or control loops.
  • "Buying a domain puts my site online": A domain is merely a registry name entry. Without configured DNS records pointing to an active host, nothing will load.
  • Sharing file:/// URLs: A file path like file:///C:/Users/... only exists on your local machine. No external user can access it.
  • "Status 404 means the server crashed": Code 404 confirms the server is working properly and responding that no file exists at that path. Server errors belong to the 5xx family.

Summary

  • The web operates on a client-server foundation (browser requests, server responds).
  • Complete request cycle: URL input → DNS IP lookup → HTTP request dispatch → HTTP response reception → secondary asset loading → browser rendering.
  • HTTP status codes: 2xx (Success), 3xx (Redirect), 4xx (Client Error), 5xx (Server Error).
  • HTTPS safeguards web traffic via TLS cryptographic encryption and certificate authentication.
  • HTML dictates structure, CSS controls styling, and JavaScript adds interactive behavior.
  • DevTools Network tab allows real-time inspection of HTTP requests, status codes, and headers.

Self-Check & Explanations

Question 1: Understanding Content-Type

Scenario: A server responds with <h1>Welcome</h1> in the body, but sets Content-Type: text/plain in the response headers. What will the browser render?

  • Answer: The browser will display literal text <h1>Welcome</h1> including angle brackets in a monospace font, rather than a formatted large heading.
  • Explanation: The browser decides how to interpret content based on Content-Type. Value text/plain signifies raw unformatted text. Visual HTML rendering requires text/html.

Question 2: Registered Domain Without Hosting

Scenario: An author registers domain example.az but hasn't configured web hosting or DNS records. What happens when navigating to the address?

  • Answer: The browser displays a DNS error (e.g. DNS_PROBE_FINISHED_NXDOMAIN or "Server IP address could not be found"). It will not return a 404 error.
  • Explanation: An HTTP 404 response requires an active web server to return it. Without DNS mapping, the connection never reaches an HTTP server.

Question 3: URL Components

Scenario: Break down https://shop.az/catalog/phones?sort=price into its 4 core parts.

  • Answer:
  • Protocol: https://
  • Domain: shop.az
  • Path: /catalog/phones
  • Parameters: ?sort=price

Review & Transition Criteria

Readiness criteria for proceeding to Lesson 002 ("Development Environment: VS Code & Live Server"):

  1. You can clearly explain the roles of domain, hosting, and IP address.
  2. You understand why editing text inside the browser inspector does not permanently alter the server files.
  3. You can open the Network panel in your browser and locate the status code of the initial document request.

3. Practice Exercises

Exercise 1 (Predict)

Given two URLs:

  1. https://prowid.com/courses/
  2. https://prowid.com/courses/non-existing-page-999

Without loading them in a browser, predict:

  • What HTTP status code do you expect for the first and second URL?
  • What happens if you replace https:// in the first URL with file:///?

Exercise 2 (Inspect)

  1. Open any major news outlet or search engine in your browser.
  2. Open developer tools (F12) and select the Network tab.
  3. Reload the page (Ctrl + R / Cmd + R).
  4. Select the initial request (type document).
  5. Record:
    - Request URL
    - Status Code
    - Response header Content-Type
    - Total number of page requests (found at bottom status bar).

Exercise 3 (Modify)

You are provided with a faulty server response that returned a success status and an incorrect document type for a non-existent page:

text
HTTP/1.1 200 OK
Content-Type: text/plain; charset=utf-8

<h1>404</h1>
<p>Page not found. Check the address.</p>

Modify this response so that:

  1. The status line declares an HTTP client error for missing resources.
  2. The browser renders the HTML markup as a webpage rather than raw text.

Exercise 4 (Own)

Imagine designing your very first portfolio website.

  1. Formulate a domain name for your project.
  2. Trace the step-by-step sequence occurring in a visitor's computer from entering the domain to seeing your page:
    - What service translates the name to an IP address?
    - What port and protocol are utilized?
    - What HTTP method is dispatched?
    - What three file types (HTML, CSS, JS) are delivered and what does each govern?

Exercise 5* (Star Challenge)

Explain why testing a local website simply by double-clicking HTML files (via the file:/// protocol) is dangerous for developers compared to running a local web server (via http://localhost). Name at least two technical discrepancies that can arise under file:///.