Home / Learn HTML / How the Web and Browsers Work

How the Web and Browsers Work

Before writing code, see what happens when you open a web page. It makes everything else easier.

In shortA browser asks a server for a file. The server sends HTML. The browser reads the tags and draws the page.

Definition

The World Wide Web is a system of pages stored on computers called servers and viewed on clients (your browser). They talk using HTTP or the secure HTTPS. HTML is only the format of the page that travels.

Theory in plain words

A page loadType URLDNS finds serverServer sends HTMLBrowser draws page
A page load

What it is

The web works by browsers asking servers for files. HTML, CSS, JavaScript and images travel over HTTP or HTTPS.

Why we use it

Knowing the path of a page helps you fix slow pages, broken links and caching problems.

How it works

You type a URL, DNS finds the server address, the browser sends a request, the server answers with HTML and the browser draws it, asking for more files as needed.

Where it is used

  • Debugging 404 and slow loads
  • Choosing hosting and CDN
  • SEO and speed work

The journey of a web page

  1. You type xtoolmint.com in the address bar.
  2. The browser finds the server with that name (DNS).
  3. The browser asks the server: "send me the page".
  4. The server sends an HTML file.
  5. The browser reads the HTML, then asks for the CSS, images and scripts it mentions.
  6. The browser draws the page for you.

Parts of a web address (URL)

PartExampleMeaning
Protocolhttps://How to talk. https is secure.
Domainxtoolmint.comThe server name
Path/merge-pdfWhich page
Query?lang=enExtra information
Fragment#topA place inside the page
Build a link from URL partsTry it Yourself
HTML, CSS and JavaScript togetherTry it Yourself
Read the source of this very boxTry it Yourself
Console message (developer tools)Try it Yourself
HTML is forgivingTry it Yourself

Browsers fix many mistakes. Still, write clean code.

Static and dynamicTry it Yourself

Quick quiz

1. What sends the HTML file to your browser?

2. In https://xtoolmint.com/merge-pdf which part is the path?

3. What does the browser do with HTML?

Common questions

What sends the HTML file to your browser?

A server. A web server answers the request with the page.

In https://xtoolmint.com/merge-pdf which part is the path?

/merge-pdf. The path says which page you want.

What does the browser do with HTML?

Reads the tags and draws the page. The browser turns tags into what you see.

My notes
Ask a question about this lesson