← Web basics: HTML, CSS and JavaScript

What happens when you open a page

Browsers, servers, and the jobs of HTML, CSS and JavaScript.

Start this lesson

When you type an address like example.org, your browser (Chrome, Safari, Firefox…) asks another computer, called a server, for that page. The server sends back plain text files. The browser reads those files and draws the page on your screen. Most pages use three languages that work as a team: HTML says what is on the page (headings, paragraphs, pictures, buttons), CSS says how it looks (colors, sizes, spacing), and JavaScript says what it does (react to clicks, change things, do math).

<h1>Corner Bakery</h1>
<p>Fresh bread every morning.</p>

<style>
  h1 { color: brown; }
</style>

<script>
  document.querySelector("p").textContent += " Open 7 to 3.";
</script>

The h1 and p lines are HTML: they put a heading and a paragraph on the page. The style part is CSS: it makes the heading brown. The script part is JavaScript: after the page loads it adds opening hours to the paragraph.

A handy picture: HTML is the skeleton of a house, CSS is the paint and furniture, JavaScript is the electricity that makes the lights switch on.

You do not need special software to start. Every exercise in this course is a tiny web page you edit right here. When you press Run, your page is shown and then checked.