sciandu
Computer science

Computer science

Websites & HTML

What happens when you open a website, and how HTML describes every page on the net.

What you need first

Reading news, watching videos, checking timetables: you open websites every day without thinking about how they come to be. Yet behind every single page sits the same simple idea. Once you understand it, you will see the web with completely different eyes.

Browser asks, server answers

When you type in an address, your browser sends a request to a server, a computer somewhere on the net that keeps websites ready. The server answers with a text file: the page's HTML. HTML describes the structure, for example headings, paragraphs, lists and links. It uses tags in angle brackets for that: a paragraph starts with <p> and ends with </p>, a big heading sits between <h1> and </h1>, a list entry between <li> and </li>, and a link between <a> and </a>. The short names are simply abbreviations: p for paragraph, h for heading, li for list item and a for anchor, the anchor a link hangs on.

HTML preview
<h1>My Recipe</h1>
<p>Pasta with <b>tomato sauce</b></p>

My Recipe

Pasta with tomato sauce

2 lines of HTML a web page

Try it: change the HTML on the left and see immediately what the browser makes of it.

From text to view

The browser reads the HTML and renders the finished view from it: it draws headings large, paragraphs as blocks of text, lists with bullets and links clickable. So on screen you normally do not see the HTML itself, but the picture the browser builds from it. That is exactly why the same page looks similar on a phone and a laptop: both browsers read the same blueprint.

Every page is made of this

Whether it is a giant shop or a small blog: every website you have ever visited is HTML in the end. Big pages simply have a lot more of it, plus styling with CSS and programs in JavaScript. But the basic skeleton is always the same, and you can look at it on any page.

Exercises

0 of 6 solved

Time to try it yourself. You can't break anything, every attempt counts.

You type in a web address. Who sends the page to your browser?

How do you recognise an HTML tag?

The paragraph <p>Hello</p> consists of one opening and one closing tag. How many tags is that?

What happens when you open a website? Put the steps in the correct order.

  1. 1The server answers with the page's HTML
  2. 2You type in an address
  3. 3The browser renders the finished view from it
  4. 4The browser sends a request to the server

A bulleted list contains 4 entries, each in its own <li> element. How many bullets does the browser show?

Match each tag pair to the element it describes.

<h1> ... </h1>
<p> ... </p>
<li> ... </li>
<a> ... </a>

Where this leads