Year 8 · Building the Web · Part D: Computers in the world

The web

In one line

A web page is text written in HTML (what's on the page), styled with CSS (how it looks), sometimes with JavaScript (what it does). Your browser fetches it from a web server using a URL and HTTP.

1

Explain why the web and the internet are not the same thing, and take any URL apart.

2

Follow one HTTP request from Enter to a drawn page, and read status codes like 200, 301, 404 and 500.

3

Read and write HTML elements and attributes, see the page as a tree (the DOM), and style it with CSS and the box model.

4

Explain HTTPS, hosting, domain names (.es and .co.uk), how search engines crawl, index and rank, and why accessibility and cookies matter.

URLThe full address of one thing on the web.
ProtocolAgreed rules for talking. HTTP is the web's.
HTMLLabels the content: headings, paragraphs, links.
CSSSays how the content looks.
Web serverA computer that sends pages when asked.
BrowserThe program that asks for pages and draws them.

The web is not the internet

People use the two words as if they mean the same. They don't. The internet is the hardware: a worldwide network of networks. The World Wide Web is one service that runs on top of it: pages, joined by links.

The internet cables, fibre, Wi-Fi, routers, IP addresses: it moves packets from any computer to any other Services that use the internet (each has its own protocol): The web pages + linksbrowser ↔ web serverHTTP / HTTPS EmailSMTP, IMAP Video callsWebRTC… Gamesown rules FiletransferFTP
The internet is the roads. The web is one kind of traffic on those roads. Email is another.
The internetThe World Wide Web
What it isHardware + rules for moving packetsA collection of pages and files, linked together
StartedARPANET, USA, 1969Tim Berners-Lee at CERN (Geneva): proposal 1989, first website 1991
Main protocolsTCP/IPHTTP and HTTPS, plus HTML for the pages
You use it withAny connected appA browser (Chrome, Safari, Firefox, Edge)
▶

Web, or just the internet?

For each one: is it using the web (pages over HTTP in a browser), or the internet without the web?

?Why?

Why "web"? Each page can link to any other page on any server in the world. Draw the links and you get a tangled web. Berners-Lee's big idea was the hyperlink plus three inventions: HTML, URLs and HTTP. He gave them away free, which is why the web spread so fast.

Reading a URL

A URL (Uniform Resource Locator) is the full address of one thing on the web: a page, an image, a video. Every part has a job. Read it left to right, like a postal address read from country down to flat number.

The domain picks the server. Everything after the first single / is for that server to work out.
PartExampleJob
Protocol (scheme)https://Which rules to use. The s means secure: encrypted.
Subdomainwww.One part of the site. Could be news., shop., or nothing.
Domain namebbcThe name the owner registered.
Top-level domain (TLD).co.ukCountry or type: .uk, .es, .com, .org, .gov.uk, .gob.es
Path/news/technologyWhich page or file on that server. Like folders.
Query?page=2Extra information for the page, as name=value. Several are joined with &.
Fragment (anchor)#topA spot within the page. Never sent to the server.
!Watch out: fake addresses

The real site is the part just before the TLD. https://www.bbc.co.uk.login-check.com/ is not the BBC: its domain is login-check.com, and "www.bbc.co.uk" is just a subdomain anyone could make. Phishing emails use this trick.

e.g.Which computer?

Computers find each other by IP address, not by name. Before anything else, your browser asks DNS to turn www.bbc.co.uk into a number like 151.101.0.81. (Topic 15 covers DNS.)

What happens when you press Enter

The web runs on one simple pattern: the browser (the client) sends a request; the web server sends back a response. The rules for these messages are called HTTP: HyperText Transfer Protocol.

Time runs downwards. A normal page needs dozens of requests: one for the HTML, then one for each stylesheet, script, image and font.
The request (browser → server)
GET /news HTTP/1.1
Host: www.bbc.co.uk
User-Agent: Firefox/131
Accept: text/html
The response (server → browser)
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 48213

<!doctype html>
<html> …the page… </html>
  1. The method says what you want. GET = "please send me this". POST = "here is some data", e.g. a form you filled in.

  2. Headers are extra lines of information: which site (Host), which browser (User-Agent), what type of file comes back (Content-Type).

  3. The status code is a 3-digit number at the top of every response. Its first digit tells you the kind of answer.

  4. The body is the actual file: HTML, an image, a video chunk. A blank line separates it from the headers.

CodeNameMeans
200OKHere it is. Everything worked.
301Moved PermanentlyIt lives at a new URL now. The browser goes there by itself.
403ForbiddenIt exists, but you're not allowed to see it.
404Not FoundNo such page on this server. Often a typo in the path.
500Internal Server ErrorThe server's own code crashed. Not your fault.
503Service UnavailableToo busy or down for maintenance. Try later.
★Remember

First digit: 2xx = success. 3xx = go somewhere else. 4xx = you (the client) asked for something wrong. 5xx = the server went wrong.

▶

Build a request, watch the response

?Why?

Why doesn't the server remember me? HTTP is stateless: every request is handled on its own, as if the server had never seen you. That keeps servers simple and fast. Sites that need to remember you (a basket, a login) use cookies (Step 11).

HTTPS and the padlock

Plain HTTP sends everything as readable text. Anyone on the path (the café Wi-Fi, a router) could read or change it. HTTPS is HTTP sent inside an encrypted tunnel built with TLS (Transport Layer Security).

Browser Web server 1. Hello! I can use these kinds of encryption. 2. Here's my certificate: "I really am this site",signed by a trusted authority. It holds my public key. 3a. Check it: rightname? In date? Trustedsigner? 3b. Swap key-making numbers. Both now share asecret session key. A spy can't work it out. 4. Everything after this is encrypted: GET /news … 200 OK …
The certificate proves who the server is. The shared session key makes the conversation private. HTTPS uses both kinds of encryption from Topic 17: public-key to agree the key, then fast symmetric encryption for the data.

What the padlock does mean

  • Nobody between you and the server can read what you send or get back.
  • Nobody can secretly change it on the way.
  • The server proved it owns this domain name.

What it does not mean

  • That the site is honest. Scam sites get free certificates too.
  • That the site is safe from viruses.
  • That the domain is the one you meant: paypa1.com can have a padlock.
e.g.Ports

A server can run many services. A port number says which one you want: HTTP uses port 80, HTTPS uses port 443. You rarely see them because the browser adds them for you.

★Exams

Both AQA 8525 and OCR J277 expect you to know what HTTP and HTTPS are for, and that HTTPS is encrypted. OCR also asks about the web as clients, servers, DNS and hosting. Neither board asks you to write HTML or CSS at GCSE.

Three languages, three jobs

Every web page is built from three layers. Keeping them separate means you can change how a site looks without touching its content, and the other way round.

HTMLstructure What is on the page:headings, paragraphs,images, links, lists<h1>Hot Potato</h1> House: walls and rooms CSSstyle How it looks:colours, fonts, sizes,spacing, layouth1 { color: red; } House: paint and furniture JavaScriptbehaviour What it does:reacts to clicks, checksforms, changes the pagebutton.onclick = … House: lights and doorbell
HTML and CSS are not programming languages: they describe, they don't calculate. JavaScript is a programming language, with variables, ifs and loops like Python.
▶

Switch the layers on one at a time

Hot Potato

A party game for four players.

How the browser draws a page

HTML file CSS file DOMtree of elements Style rulesselector → look Combinestyled tree Layoutwhere + size Paintpixels JavaScript runs changes the DOM →→ layout and paint happen again

HTML: tags, elements and attributes

HTML (HyperText Markup Language) labels each piece of content so the browser knows what it is. A label is a tag in angle brackets. Most come in pairs: an opening tag and a closing tag with a slash.

Tag = the label in angle brackets. Element = opening tag + content + closing tag. Attribute = extra information inside the opening tag, as name="value".
<h1>Hot Potato</h1>
<p>A party game for <strong>four</strong> players.</p>
<img src="potato.png" alt="A cartoon potato with a fuse">
<a href="https://example.com">Visit the site</a>
<ul>
  <li>Fast rounds</li>
  <li>Silly physics</li>
</ul>
TagMeansKey attributes
<h1> … <h6>Headings: h1 biggest and most important, one per page
<p>A paragraph
<strong> / <em>Important (bold) / emphasis (italic)
<a>A link: the "hyper" in hypertexthref
<img>An image. No closing tag (an empty element)src, alt, width
<ul> <ol> <li>Bullet list, numbered list, each item
<div>A box to group things (for CSS layout)class, id
<table> <tr> <td>Table, row, cell
<form> <input> <button>Things the user types into or pressestype, name
!Watch out

Nest tags like boxes inside boxes: close the inner one first. <p><strong>hi</strong></p> is right. <p><strong>hi</p></strong> is wrong. Browsers try to guess what you meant, so mistakes often don't show, until they do.

Page structure: head, body and the DOM tree

A whole HTML page has a fixed skeleton. The head holds information about the page. The body holds what you actually see. The browser turns it into a family tree called the DOM (Document Object Model).

<!doctype html>
<html lang="en-GB">
  <head>
    <meta charset="utf-8">
    <title>Hot Potato</title>
    <link rel="stylesheet" href="style.css">
  </head>
  <body>
    <h1>Hot Potato</h1>
    <p>A <strong>party</strong> game.</p>
    <img src="potato.png" alt="A potato">
  </body>
</html>
  1. <!doctype html> tells the browser "this is modern HTML". It's not a tag; it's a notice.

  2. <html lang="en-GB"> is the root: everything else is inside it. lang tells screen readers which accent to use.

  3. <head> is metadata: data about the page. The <title> shows in the browser tab and in search results. <link> loads the CSS file.

  4. <body> is everything drawn on screen.

  5. In the tree, an element inside another is its child. strong is a child of p, which is a child of body. JavaScript finds and changes elements by walking this tree.

?Why?

Why indent the code? The browser ignores the spaces. Indenting is for people: each level of indent is one level down the tree, so you can see at a glance what is inside what, just like indentation in Python.

CSS: selectors, properties and the box model

CSS (Cascading Style Sheets) is a list of rules. Each rule says: "find these elements, and make them look like this". One CSS file can style every page of a website.

SelectorPicksHTML it matches
pevery element of that type<p>
.warningevery element with that class (dot)<p class="warning">
#logothe one element with that id (hash)<img id="logo">
nav aany a that is inside a nav<nav><a>
PropertyChangesExample value
colortext colour (American spelling!)#C0392B, red, rgb(192,57,43)
background-colorcolour behind the element#FFF3D4
font-family / font-sizetypeface / text sizeArial / 18px
text-alignleft, centre or rightcenter
width, padding, border, marginthe box model, below200px, 10px, 2px solid black
?Why "cascading"?

Several rules can hit the same element. They cascade like a waterfall: a more specific selector wins (#id beats .class beats p), and if two are equally specific, the later one wins.

The box model

Every element is drawn as a rectangle with four layers, from the inside out.

Padding is inside the border and takes the element's background colour. Margin is outside and is always see-through.
▶

Box model playground

Hosting, domain names and page weight

To put a site on the web you need two things. Hosting: a web server, a computer that is always on and always connected, to keep your files and send them out. And a domain name, so people can find that server.

Read a domain name from the right: bbc.co.uk = UK → companies → BBC. Each level is run by someone different.
SpainUK
Country TLD.es.uk, .co.uk
Who runs it (the registry)Red.es (dominios.es), a Spanish public bodyNominet, a UK not-for-profit company
Government.gob.es (e.g. sede.agenciatributaria.gob.es).gov.uk (e.g. www.gov.uk)
Universities.es (e.g. ucm.es).ac.uk (e.g. ox.ac.uk)
  1. Register a domain through a registrar (a shop that sells names). You rent it, usually by the year. Nobody owns a name for ever.

  2. Rent hosting: space on a web server in a data centre, from a hosting company or a cloud provider. Or run your own server, if it can stay on all the time.

  3. Point the name at the server: add a DNS record that says "hotpotato.es → this IP address".

  4. Upload your files (HTML, CSS, images). Now any browser in the world can request them.

e.g.Static or dynamic?

A static site sends the same files to everyone, like this study page. A dynamic site runs code on the server (often with a database) to build a fresh page for each person: your Amazon basket, your Instagram feed.

How long does a page take to arrive?

A page's weight is the size of everything it needs: HTML, CSS, scripts, images, fonts. A typical home page today weighs about 2 to 3 MB, mostly images.

  1. A 3 MB page on a 20 Mbps connection. File sizes are in bytes (big B), speeds in bits (small b).

  2. Turn megabytes into megabits: 3 × 8 = 24 megabits. (8 bits in every byte.)

  3. Each second, 20 megabits arrive. How many seconds for 24? 24 ÷ 20 = 1.2 seconds.

  4. Make the page lighter: shrink the images to 1 MB in total. 1 × 8 = 8 megabits. 8 ÷ 20 = 0.4 seconds. Three times faster.

  5. Real pages are a bit slower: each of the dozens of requests has a round-trip delay (latency) before data starts flowing.

?Why?

Why does page weight matter? On a slow phone connection or a capped data plan, a heavy page costs time and money. Search engines also rank faster pages a little higher.

Search engines: crawl, index, rank

A search engine can't read the whole web when you press Search: that would take years. It does the hard work in advance, in three stages. When you search, you search its index, not the live web.

1. Crawl A crawler (spider) program:• downloads a page• collects its links• adds them to a queue• repeats, for everPages nobody links tomay never be found. 2. Index For every word: whichpages contain it. potato → A, B, D, Eparty → A, Cchips → B, DLike the index at theback of a book. 3. Rank Look the words up in theindex, then put matchesin order using:• relevance (title, words)• trust: links from others• speed, freshness, phone- friendly, your location

PageRank: links are votes

Google's first big idea (Larry Page and Sergey Brin, 1998) was PageRank. A link from page X to page Y is a vote for Y. But votes aren't equal: a vote from a popular page counts more, and a page that links to many others splits its vote between them.

  1. Give every page the same score to start: 1 ÷ (number of pages).

  2. Each round, every page shares its score equally among the pages it links to.

  3. A page's new score = a small fixed amount + 0.85 × (the shares it received). The 0.85 is the chance a surfer keeps clicking links instead of typing a new address.

  4. Repeat until the scores stop changing. Pages with many links from high-scoring pages end up on top.

▶

Run a tiny search engine

Six web pages. The crawler starts at page A. Press Next to crawl, then index, then rank. Then search.

!Watch out: SEO tricks

Page E repeats "potato" again and again to look relevant. This is keyword stuffing. Ranking by word count alone falls for it; ranking by links doesn't, because nobody important links to E. Real search engines use hundreds of signals and punish tricks like this. SEO (search engine optimisation) done honestly means clear titles, good headings, fast pages and content people want to link to.

Accessibility and cookies

A good website works for everyone, including people who are blind, deaf, dyslexic, colour-blind or can't use a mouse. And it is honest about what it remembers about you.

Accessibility

Do thisWho it helpsIn HTML / CSS
Alt text on every meaningful imageBlind people using a screen reader, which reads the page aloud<img alt="Team photo, 4 students holding a trophy">
Strong contrast between text and backgroundLow vision, bright sunlight, dyslexiacolor + background-color
Real headings in order (h1, then h2…)Screen-reader users jump between headings<h1> <h2>
Links that make sense alone"Download the timetable", not "click here"<a>
Works with a keyboard (Tab, Enter)People who can't use a mouse<button>, not a clickable <div>
Captions on videosDeaf people; anyone in a noisy room<track>
Don't use colour aloneColour-blind people (about 1 in 12 boys)add a word or icon too
▶

Contrast checker

Normal text: the quick brown fox.

Large text

★The rules

The world standard is WCAG (Web Content Accessibility Guidelines). Level AA asks for a contrast ratio of at least 4.5 : 1 for normal text and 3 : 1 for large text. UK: the Equality Act 2010 and, for public bodies like state schools, the Public Sector Bodies Accessibility Regulations 2018. Spain: Real Decreto 1112/2018 for public-sector websites, and Ley 11/2023, which brings in the EU's European Accessibility Act for many businesses from June 2025.

Cookies

A cookie is a small piece of text a website asks your browser to keep, like basket=3items. Your browser sends it back with every request to that site. That's how a stateless protocol remembers you.

Browser Web server GET /login (username + password sent) 200 OKSet-Cookie: session=7f3a 🍪 stored: session=7f3a GET /basket Cookie: session=7f3a "Ah, it's you. Here's your basket."
KindUsed forNeeds your consent?
Strictly necessaryKeeping you logged in, your basket, remembering you said no to cookiesNo
PreferencesLanguage, dark modeSpain: usually yes. UK: often not, since 2025 (see below)
AnalyticsCounting visitors to improve the siteSpain: yes. UK: not always, since 2025 (see below)
Third-party trackingSet by an advertiser's domain on many sites, to follow you around the web and target advertsYes, in both
!The law

UK: the Privacy and Electronic Communications Regulations (PECR) need consent before storing cookies, except strictly necessary ones. The Data (Use and Access) Act 2025 adds exceptions for some low-risk cookies, such as analytics used only to improve a site, as long as users are told clearly and can object. Spain: article 22.2 of the LSSI (Ley 34/2002) needs informed consent for anything not strictly necessary, and the regulator, the AEPD, says rejecting must be as easy as accepting. Both countries' data-protection laws (UK GDPR / EU GDPR + LOPDGDD) apply when cookies identify a person.

Common mix-ups

The mistakes almost everyone makes at first. Read the left side, then the right.

People think

The web and the internet are the same thing.

Actually

The internet is the network. The web is one service on it, alongside email, games and video calls.

People think

A 404 error means the internet is broken.

Actually

The server answered fine. It just has no page at that path. Check the URL for typos.

People think

The padlock means the site is safe and honest.

Actually

It only means the connection is encrypted and the domain is proven. Scam sites have padlocks too.

People think

HTML is a programming language.

Actually

HTML is a markup language: it labels content. No variables, no ifs, no loops. JavaScript is the programming language.

People think

Padding and margin are the same thing.

Actually

Padding is inside the border (gets the background colour). Margin is outside (always see-through).

People think

A search engine searches the whole web when you press Enter.

Actually

It searches its own index, built earlier by crawlers.

People think

The domain is whatever comes after www.

Actually

Read from the right: the registered name is the part just before the TLD. bbc.co.uk.evil.com belongs to evil.com.

People think

Cookies are programs that can spy on your computer.

Actually

A cookie is just a small piece of text. It can't run. Tracking comes from many sites sharing one third-party cookie.

Check yourself

Quick questions first. Then endless practice: a wrong answer shows you the working, step by step.

[ {"q":"In https://www.bbc.co.uk/news, the path is…","o":["https://","www.bbc.co.uk","/news"],"a":2,"w":"The path comes after the domain. It says which page on that server."}, {"q":"404 means…","o":["OK","Not found","The server crashed"],"a":1,"w":"The server works, but there's no page at that path. A crash would be 500."}, {"q":"Which controls how a page looks?","o":["HTML","CSS","DNS"],"a":1,"w":"CSS = style. HTML = content and structure."}, {"q":"The web and the internet are…","o":["The same thing","The web is a service that runs on the internet","The internet runs on the web"],"a":1,"w":"The internet is the network. The web is pages over HTTP, one of many services using it."}, {"q":"In <img src=\"cat.png\" alt=\"A sleeping cat\">, alt is…","o":["A tag","An attribute","A CSS property"],"a":1,"w":"Attributes sit inside the opening tag as name=\"value\". alt describes the image for screen readers."}, {"q":"A box has width 100px, padding 10px, border 2px, margin 5px. How wide is it on screen, from border edge to border edge?","o":["112px","124px","134px"],"a":1,"w":"Content + padding on both sides + border on both sides: 100 + 20 + 4 = **124px**. Margin is outside the border."}, {"q":"The padlock in the address bar tells you…","o":["The site is honest","The connection is encrypted with HTTPS","The site has no viruses"],"a":1,"w":"It proves the domain and encrypts the traffic. It says nothing about honesty."}, {"q":"When you search, a search engine looks in…","o":["The live web, right then","Its index, built earlier by crawlers","Your browser history"],"a":1,"w":"Crawl → index happen in advance. Searching just looks words up in the index, then ranks the matches."} ]