Websites

How do websites work?

From a URL to a page

When you open a web address, the browser needs to locate the server responsible for that domain. DNS translates the human-readable domain name into an IP address so the browser can connect to the right destination.

The browser then sends an HTTP request for a resource, commonly the page's HTML. The server responds with the requested resource and status information. The browser may then make additional requests for stylesheets, scripts, images, fonts, and other files.

What the browser does

The browser parses the HTML into a document structure, loads the styles and scripts it needs, and renders the result for the user. JavaScript can change the page or request additional data after the initial document has loaded.

This is why a website is more than a single file. The browser is assembling an experience from multiple resources and instructions.

Where hosting fits

A web server or hosting environment stores or generates the resources that the browser requests. For a simple static site, the server can return prepared files. A dynamic application may use server-side code and databases to generate or retrieve data before responding.

The practical model

For beginners, remember the flow: domain name → DNS lookup → server connection → HTTP request → response → browser rendering. You do not need to understand every networking detail before building a useful site, but this model explains many common problems.

Sources and further reading

Frequently asked questions

How does a website work?

The browser asks a server for the address. The server sends HTML, CSS, and other files. The browser turns those files into the page you see.

What is a server?

A computer that stays on and answers requests for your site. Hosting is renting that service, or using a builder that includes it.

What is HTML?

The structure of the page: headings, paragraphs, links, and images. CSS changes how that structure looks.

What happens when I click a link?

The browser requests another URL. If it is your site, your server answers. If it is another site, their server answers.

Why does a site look different on a phone?

The layout should adapt. If it was built only for a wide screen, the phone has to shrink it. A responsive page is designed for both.

What is a URL?

The address of a page. It includes the site name and the path, such as /learn/websites.