How the Web Works
A website is a set of files (HTML, CSS, JavaScript, images) delivered by a server to a browser over HTTP.
The three core languages
| Language | Responsibility | Analogy |
|---|---|---|
| HTML | Structure and content | The skeleton |
| CSS | Presentation and layout | The skin and clothes |
| JavaScript | Behaviour and interactivity | The muscles |
Front end and back end
- Front end (client): runs in the browser; HTML, CSS, JavaScript, frameworks (React, Vue).
- Back end (server): runs on a server; business logic, databases, authentication (Node.js, Python, Java).
- APIs connect them, usually JSON over HTTP.
From request to pixels
- The browser requests the HTML document.
- It parses HTML into the DOM and discovers CSS, JS and images.
- CSS is parsed into the CSSOM; DOM + CSSOM form the render tree.
- The browser performs layout and paint.
- JavaScript can change the DOM at any time, triggering more layout and paint.
Your first page
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>My first page</title>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<h1>Hello, web!</h1>
<script src="app.js" defer></script>
</body>
</html>
Developer tools
Press F12 (or right-click and choose Inspect) to open DevTools: Elements (DOM and CSS), Console (logs and errors), Network (requests), Performance and Lighthouse (audits).
TIP
Learn the browser's DevTools early. Most front-end debugging is inspecting the DOM, the computed styles and the network tab.
Loading Comments...