1. How the Web Works & Semantic HTML5

How the Web Works: URLs, DNS, HTTP & Browsers

Understand what happens behind the scenes when you type a website URL: IP addresses, DNS lookups, HTTPS requests and responses, status codes, and how browsers turn code into pixels.

5 min readUpdated 2026-11-29
In This Lesson
  • Trace the journey from typing a URL to seeing a rendered page in your browser
  • Read the parts of a URL, HTTP request methods (GET vs POST), and status codes
  • Understand how browsers parse HTML, CSS, and JavaScript into a live page

Before writing a single tag of HTML, it helps to know where your website files actually live and how they travel across the world onto someone's phone screen in half a second.

Every time you click a link or type an address into Chrome, Safari, or Firefox, a quiet conversation happens between two computers:

  • The Client: Your browser (running on your laptop or phone). It asks for pages and draws them on screen.
  • The Server: Another computer sitting in a data center that stores the website's files, images, and database records, waiting to answer requests 24/7.

What Happens When You Type a Website URL?

Suppose you visit https://yadavacademy.com/courses?level=beginner. Four fast steps turn that text into a glowing page on your screen:

  1. DNS Lookup (The Internet's Phonebook): Computers find each other using numeric IP addresses (like 142.250.190.46), not English domain names. Your browser asks a DNS (Domain Name System) server: "What IP address belongs to yadavacademy.com?"
  2. Secure Connection (TCP + TLS/HTTPS): Your browser connects to that server IP and performs an encrypted handshake (https://) so nobody on public Wi-Fi can spy on passwords or form submissions.
  3. HTTP Request & Response: Your browser sends an HTTP Request asking for /courses?level=beginner. The server runs its logic and sends back an HTTP Response containing HTML code, a status code (200 OK), and headers.
  4. Browser Rendering Pipeline: The browser reads the HTML top-to-bottom to build the page structure (DOM), downloads linked CSS stylesheets to apply colors and layout, and executes JavaScript to wire up buttons and interactivity.

Anatomy of a URL

Understanding URL parts stops backend errors and broken links from ever feeling mysterious:

text
https://   yadavacademy.com   /courses/python   ?track=free   #syllabus
└─┬──┘     └──────┬───────┘   └──────┬──────┘   └─────┬─────┘ └────┬────┘
Protocol       Domain               Path          Query Params  Fragment
PartExampleWhat It Does
Protocolhttps://Rules for sending data (https encrypts traffic; http does not)
Domainyadavacademy.comHuman-friendly name mapped by DNS to a server IP
Path/courses/pythonSpecific resource or page requested on that server
Query String?track=freeExtra key=value filters or search terms passed to the server
Fragment#syllabusJumps the browser straight to a section ID inside that page (stays local!)

HTTP Methods & Status Codes You Will See Every Day

Every HTTP request carries a verb (method) describing the user's intent, and every response returns a 3-digit status code summarizing the outcome:

CategoryCode / MethodPlain-English Meaning
MethodGET"Please send me this page or data." (Safe to refresh; never modifies server data.)
MethodPOST"Here is form data—create an account, post a comment, or save an order."
MethodPUT / PATCH"Update an existing record." (PUT replaces whole record; PATCH updates chosen fields.)
MethodDELETE"Remove this specific record."
2xx Success200 OK / 201 CreatedRequest succeeded (201 confirms a new resource was saved).
3xx Redirect301 / 302Page moved—browser automatically jumps to the new URL.
4xx Client Error400, 401, 403, 404Something went wrong on the caller's side: bad data (400), not logged in (401), forbidden (403), or wrong URL (404 Not Found).
5xx Server Error500, 503Your browser asked politely, but the backend server crashed or overloaded.
How to Remember 4xx vs 5xx Instantly

4xx means "Client mistake" (check your URL spelling, missing header, or login token). 5xx means "Server mistake" (the backend server threw an error or went down).

The Frontend Trio Inside Every Response

Once an HTML document arrives in your browser, all modern websites—from simple portfolios to full applications—rely on three languages working together like constructing a home:

  • HTML builds the skeleton & meaning (headings, paragraphs, forms, buttons, links).
  • CSS adds paint, spacing & layout (colors, typography, cards, mobile responsiveness).
  • JavaScript wires up electricity & behavior (filtering search results, opening modals, fetching live updates without reloading).

Try Inspecting a Live Page Structure

In the playground below, click Run & Preview to render a minimal HTTP response body with all three pieces working side by side, then change the button message to watch JavaScript react immediately:

HTML / CSS / JSHTML Structure + CSS Styling + JavaScript Behavior
Live Browser Preview

Quick Checkpoints

Check Your Understanding

Your browser requests /dashboard without being logged in yet, and the server blocks access because authentication is missing. Which status code range applies?

Check Your Understanding

What is DNS responsible for when you visit a website?