Demo mode This site is not live. It is currently being tested and developed. Nothing on here represents an offer.
← Exit course WEB-101 Web Development for Beginners: HTML and CSS
Course progress, 0 of 8 parts done0%

What web developers actually build

Download as PDF

How a page reaches your screen, who builds it, and the tools you will use

Before you write a single line of code, it helps to know what you are building and where it fits. This lesson explains what happens between typing a web address and seeing a page, who does which job in building a website, and what the three languages of the web each contribute. You will also install the editor you will use for the rest of the course and look inside some real websites with the tools professional developers use every day.

The internet and the web are not the same thing

People use the two words as if they meant the same thing. They do not, and the difference explains a great deal about how websites work.

The internet is a worldwide network of computer networks. It is the cables under the sea, the fibre in the street, the cellphone towers, the Wi-Fi router in your home and the agreed rules (called protocols) that let all of these pass data to each other. Its roots go back to research networks in the United States in the late 1960s. The internet carries many different services: email, video calls, online games, file transfers and much more.

The World Wide Web, or simply the web, is one of those services. It is a huge collection of documents and applications, linked to each other, that you reach with a web browser such as Chrome, Firefox, Edge or Safari. Tim Berners-Lee proposed it in March 1989 while working at CERN, the European physics laboratory near Geneva. By the end of 1990 the first web server and the first browser were running at CERN, and the first website lived at the address info.cern.ch. In April 1993 CERN made the web's software available royalty-free, which is a large part of why the web spread so quickly.

Websites and web applications

You will hear developers talk about both websites and web applications. There is no sharp line between them, but the difference is useful.

Websites and web applications compared
WebsiteWeb application
Main purposeTo give you informationTo let you get something done
What you mostly doRead, look, follow linksLog in, fill in forms, change data
Is the content the same for everyone?Usually, yesNo, it depends on who you are
ExamplesA restaurant's menu page, a school's home page, a government information pageOnline banking, an e-hailing app's web booking page, an online shop's checkout, webmail

Many sites are both. A supermarket's site has information pages about its stores, and an online shop with your account, your trolley and your order history. In this course you build a website: a landing page for a small bakery. The later courses in this pathway move on to web applications.

What happens when you visit a web page

Typing an address and pressing Enter sets off a chain of events that usually finishes in well under a second. Understanding that chain is the foundation of everything else in web development, so it is worth taking slowly.

Step 1: the address, or URL

Every page on the web has an address called a URL (Uniform Resource Locator). Take this one, for an invented page:

https://www.thandekasbakery.co.za/menu/breads.html
The parts of a URL
PartIn the exampleWhat it means
SchemehttpsThe protocol to use. HTTPS is the secure, encrypted version of HTTP, the protocol of the web.
Domain namewww.thandekasbakery.co.zaThe human-friendly name of the server that holds the page. .co.za is the South African commercial domain.
Path/menu/breads.htmlWhich file or page on that server you want, much like a folder path on your own computer.

A URL can have more parts, such as a query string after a question mark (?search=rye), but scheme, domain and path are the ones to recognise first.

Try it: read three addresses

Open three websites you use: your bank, a news site and a government site such as www.sars.gov.za. Click into the address bar of each and copy the full address into a note. For each one, write down the scheme, the domain name and the path. Then find a page on one of them whose address has a question mark in it, such as a search results page, and write down what comes after the question mark.

Most browsers hide part of the address until you click into the bar, so click first and then copy.

Step 2: finding the server with DNS

Computers on the internet find each other by number, not by name. Each one has an IP address, such as 203.0.113.25 (an example only). People are bad at remembering numbers like that, so the internet has a directory service called the Domain Name System, or DNS. Your browser asks a DNS server, "What is the IP address for www.thandekasbakery.co.za?" and gets a number back. DNS works much like your phone's contacts list: you tap a name and the phone dials the number.

Step 3: the request

Now the browser knows where to go, it connects to the server and sends a request. The request is a short message written in HTTP. In plain words it says, "Please give me /menu/breads.html." It also says which browser is asking and what kinds of content it can handle. The most common kind of request is a GET request, which asks for something. When you send in a form, your browser usually sends a POST request instead, which sends information to the server.

Step 4: the server's response

The web server is a program running on a computer, often in a data centre, whose job is to wait for requests and answer them. It finds the page, or builds it, and sends back a response. Every response starts with a three-digit status code that says how things went.

Status codes you will meet first
CodeNameWhat it means
200OKHere is what you asked for.
301Moved PermanentlyThat page has a new address. The browser follows it automatically.
404Not FoundThe server is working, but there is nothing at that path. Usually a mistyped or outdated link.
500Internal Server ErrorSomething went wrong on the server itself. Not your fault as the visitor.

The codes are grouped by their first digit. Codes starting with 2 mean success, 3 means "look elsewhere", 4 means a problem with the request, and 5 means a problem on the server. Knowing just that grouping already helps you diagnose problems.

Try it: ask for a page that is not there

Go to https://www.gov.za/thandeka-cake-menu. The government's server is working, but there is no page at that path, so you should see its "page not found" page. That page is the server's answer with status code 404. You will see the code itself in the developer tools later in this lesson. Now type a domain name that does not exist, such as https://www.thandekasbakery-test.co.za. This time your browser shows its own error, because DNS could not find the server at all, so no request was ever sent. Notice the difference: one is the server saying no, the other is never reaching a server.

Step 5: more requests, then the page appears

The first response is usually an HTML file. As the browser reads it, it finds references to other files the page needs: stylesheets, scripts, images and fonts. It sends a separate request for each one. A busy news site can need well over a hundred requests to show one page. Only when enough of them have arrived does the browser render the page, which means drawing it on your screen.

Browser DNS Web server 1. Which address? 2. IP address 3. Request: GET the page 4. Response: 200 OK + HTML 5. GET the CSS, JavaScript, images 6. Each file, with its own status 7. The browser draws the page
Figure 1.1: From address to page. Time runs downwards. DNS finds the server, the browser asks for the page, and then it asks again for every file the page needs. The whole exchange usually takes well under a second.

HTTP and HTTPS

Plain HTTP sends everything as readable text. Anyone able to watch the traffic, such as someone on the same public Wi-Fi network, could read it. HTTPS encrypts the conversation between your browser and the server, so that only the two of them can read it. The padlock or settings icon next to the address shows that a page arrived over HTTPS. Today almost every serious site uses HTTPS, browsers warn you when a site does not, and the free hosting you use in Module 5 gives you HTTPS automatically.

Worked example: following one page load

Sipho types https://www.thandekasbakery.co.za into his browser on his phone. Here is what happens, step by step.

  1. The browser reads the scheme (https) and the domain name. There is no path, so it will ask for the site's home page, usually a file called index.html.
  2. It asks DNS for the IP address of www.thandekasbakery.co.za and gets a number back.
  3. It connects to that server over an encrypted HTTPS connection and sends a GET request for the home page.
  4. The server finds index.html and replies with status code 200 and the HTML.
  5. The browser reads the HTML and finds it needs styles.css, script.js and three photographs. It sends a GET request for each.
  6. One photograph's address has a typing mistake, so that request comes back with status 404. The page still appears, but with a gap or a broken-image icon where that photograph should be.

Notice that one failed request did not stop the page. Each file is requested separately and succeeds or fails on its own. This is exactly the kind of problem you will learn to spot with the browser's developer tools later in this lesson.

The front end, the back end and the database

Developers divide a web project into layers. Each layer has a different job, runs in a different place and often uses different languages.

Front end
Everything that runs in the visitor's browser: what they see and interact with. It is built with HTML, CSS and JavaScript. Also called the client side.
Back end
The programs that run on the server: checking passwords, working out prices, processing orders, deciding what to send back. It is written in a server language such as PHP, Python, JavaScript (using Node.js), Java or C#. Also called the server side.
Database
An organised, permanent store of data, such as customers, products and orders, which the back end reads from and writes to. PostgreSQL and MySQL are well-known examples.
Front end in the browser HTML CSS JavaScript What the visitor sees and uses request answer Back end on the server Checks logins and permissions Applies the business rules and prices Builds pages and answers read, write data Database stored permanently Customers, orders, products, stock Still there next week, on any device
Figure 1.2: The three layers of a web application. The visitor only ever sees the front end. The back end and the database do their work out of sight.
Worked example: ordering a cake online

Imagine Thandeka's Bakery has grown and now takes cake orders online. A customer, Lerato, orders a birthday cake. Here is which layer does what.

One cake order, layer by layer
What happensLayer
The order page appears, with the cake photos and the size options laid out neatlyFront end (HTML and CSS)
When Lerato picks a larger size, the price on the page updates straight awayFront end (JavaScript)
The page warns her, before she sends the order, that she has left the collection date emptyFront end (JavaScript)
She presses Order, and the server checks that the date is not a Sunday, when the bakery is closedBack end
The order, with her name and phone number, is savedDatabase
The server sends back a confirmation page with an order numberBack end, then front end to display it
The next morning, the baker's list of today's orders shows Lerato's cakeBack end reading from the database

Notice that the date is checked twice: once in the browser, to help Lerato quickly, and again on the server. That is deliberate. Anything running in the browser can be switched off or changed by the visitor, so the back end must never trust that the front end did its checking.

What full-stack means

The layers stacked together, from the browser down to the database, are called the stack. A full-stack developer is someone who can work in all of them: they can build the page, write the server code and design the database. In practice most full-stack developers are stronger in some layers than others. The phrase means "can work across the whole application", not "knows everything".

HTML, CSS and JavaScript: one job each

The front end uses three languages, and each has a distinct job. Keeping them separate is one of the first good habits you will learn.

The three languages of the front end
LanguageIts jobCompared to a house
HTML (HyperText Markup Language)The content and its structure: this is a heading, this is a paragraph, this is a link, this is the main menu.The walls, rooms and doors
CSS (Cascading Style Sheets)The appearance: colours, fonts, spacing, and the layout on large and small screens.The paint, furniture and how the rooms are arranged
JavaScriptThe behaviour: what happens when you click, type or scroll.The electricity: lights that switch on, a doorbell, a gate motor

Here is a tiny example of all three working on one button. You do not need to understand every symbol yet. Each of the next three modules teaches one of these languages properly.

index.html
<h1>Thandeka's Bakery</h1>
<p id="hours">Open Monday to Saturday, 6am to 2pm</p>
<button id="order">Order a cake</button>
styles.css
h1 {
  color: #6B3E26;
  font-family: Georgia, serif;
}
button {
  background: #D4583A;
  color: white;
  padding: 10px 20px;
}
script.js
const button = document.querySelector("#order")
button.addEventListener("click", () => {
  button.textContent = "Thank you! We will call you."
})

Read them in order. The HTML says there is a heading, a paragraph and a button. The CSS says the heading is brown and in a serif font, and the button is coral with white text and some space inside it. The JavaScript says that when the button is clicked, its text should change. Remove the CSS and the page still works, it just looks plain. Remove the JavaScript and the page still shows everything, but the button does nothing. Remove the HTML and there is nothing left for the other two to work on. HTML always comes first.

Looking inside real websites with developer tools

Every modern browser has built-in developer tools, usually called DevTools. They let you see the HTML, CSS and JavaScript of any page, watch every request the page makes, and even change the page temporarily on your own screen. Professional developers keep them open most of the day. Learning them from your first week will make everything else in this course easier.

Opening the tools

In Chrome, Edge or Firefox on Windows or Linux Mint:

  • Press F12, or
  • Press Ctrl+Shift+I, or
  • Right-click any part of the page and choose Inspect (Chrome and Edge) or Inspect or Inspect Element (Firefox, depending on the version). This also selects the part you right-clicked.

The tools open in a panel, usually at the side or bottom of the window, with several tabs along the top. The names differ slightly between browsers. These three matter most in this course.

The three developer tool panels you will use first
PanelChrome and Edge nameFirefox nameWhat it shows
Page structureElementsInspectorThe page's HTML as a tree, and the CSS applied to whatever you select
RequestsNetworkNetworkEvery request the page makes, with its status code, type, size and time
MessagesConsoleConsoleErrors and messages from JavaScript, and a place to type JavaScript yourself

The Elements panel

Here you see the page's HTML laid out as a tree. Each line is an element, such as a heading or a paragraph, and the small arrows open and close the elements inside it. As you move your mouse over a line, the browser highlights that part of the page. The side pane shows the CSS rules that apply to the selected element, with crossed-out lines for rules that were overridden by others.

You can double-click text in the Elements panel and change it, or untick a CSS rule to switch it off. The page on your screen changes immediately. Nothing changes on the real website. The moment you reload, the page comes back exactly as the server sent it. This makes the Elements panel a safe place to experiment.

Try it: change a page on your own screen

Open any news site and press F12. Click the arrow icon at the top left of the developer tools (it selects an element when you click it on the page), then click the main headline. Double-click the headline's text in the Elements panel, type a new headline and press Enter. Now find the colour rule for the headline in the styles pane, click the small coloured square beside it and pick a different colour. Reload the page and watch everything go back.

The Network panel

This panel records requests while it is open, so open it first and then reload the page with F5 or Ctrl+R. You see a row for every request: the file name, the status code, the type (document, stylesheet, script, image, font and so on), its size and how long it took. At the bottom is a summary, including the total number of requests. The first row is normally the HTML document itself, the request that started everything.

Look for any status code in red, such as 404. That is a file the page asked for and did not get. You now know what that means.

The Console panel

When JavaScript goes wrong, the error appears here, usually in red, with the file name and the line number. Many big sites have a few errors or warnings in the console that their own developers have not cleaned up, so do not be alarmed if you see some. In Module 4 you will use the console to find and fix errors in your own script.

Worked example: investigating a broken image

Ayanda runs a small guesthouse in Knysna and notices that one photo on her website's home page shows a broken-image icon. She opens the page, opens DevTools and goes to the Network panel.

  1. She reloads the page with the Network panel open.
  2. She clicks the Img filter (Firefox calls it Images) to show only image requests.
  3. One row is red, with status 404, for a file called pool-view.JPG.
  4. She checks the files her web designer uploaded and finds the file is actually called pool-view.jpg, with a lower-case extension.

On many web servers, file names are case-sensitive, so .JPG and .jpg are different files. The fix is to make the name in the HTML match the real file name exactly. Ayanda can now tell her designer precisely what is wrong, instead of saying "the picture is broken".

Who builds the web: roles in a web team

On a small project, one person may do everything. In larger organisations, the work is shared between people with different specialities. The job titles vary from company to company, but these are the ones you will see most often in job advertisements.

Common web development roles
RoleWhat they mostly do
Front-end developerBuilds what the user sees and uses, in HTML, CSS and JavaScript, often with frameworks built on them. Cares about layout, accessibility and speed in the browser.
Back-end developerWrites the server-side code, designs and queries the database, and builds the business rules, logins and data handling.
Full-stack developerWorks across front end and back end. Common in small companies and start-ups.
UX or UI designerDesigns how the site should work and look before it is built: user research, page flows, wireframes and visual design. UX means user experience, and UI means user interface.
Quality assurance (QA) testerTests the site to find faults before users do, often writing automated tests.
DevOps or platform engineerLooks after the servers, the hosting and the automated processes that test and release new versions.
Content and SEO specialistWrites and organises content and helps search engines find it. SEO means search engine optimisation.

Whatever role people end up in, they share the foundation this course gives you: knowing how a page reaches the browser, and being able to read and write HTML, CSS and some JavaScript. Even designers and testers work better when they understand what developers are dealing with.

Setting up your tools

A web page is just text files, so in principle you could write one in Notepad. In practice developers use a code editor, which colours your code so it is easier to read, completes words as you type, and spots many mistakes. This course uses Visual Studio Code, usually called VS Code. It is free, made by Microsoft, runs on Windows, Linux and macOS, and is one of the most widely used editors in the industry.

Installing VS Code on Windows

  1. Go to code.visualstudio.com and download the Windows installer. Be sure you are on that official address, not an advertisement or a download site.
  2. Run the installer and accept the licence agreement.
  3. On the Select Additional Tasks screen, tick both Add "Open with Code" action options. These let you right-click a folder and open it straight in VS Code. Leave Add to PATH ticked. If the installer offers anything else, such as installing GitHub Copilot, you can skip it. This course does not use it.
  4. Finish the installation and open VS Code.

Installing VS Code on Linux Mint

  1. Go to code.visualstudio.com and download the .deb file, which is the package format Linux Mint uses.
  2. Open your Downloads folder and double-click the file. The package installer opens. Click Install Package and enter your password.
  3. If you are asked whether to add the Microsoft repository, choose Yes. This means VS Code will be updated together with the rest of your system through the Update Manager.
  4. Open VS Code from the Menu, under Programming.

Showing file extensions on Windows

Windows hides file extensions by default, so a file called index.html may show only as index. Developers always need to see them, because the extension tells the browser and the editor what kind of file it is. In File Explorer, open the View menu, choose Show and tick File name extensions. In Windows 10, the File name extensions tick box is on the View tab of the ribbon. Linux Mint shows extensions already.

Your project folder

Every project lives in its own folder. For this course, create a folder called bakery-site somewhere easy to find, such as your Documents folder. Then, in VS Code, choose File, then Open Folder, and select it. VS Code may ask whether you trust the authors of the files in the folder. You created it yourself, so choose to trust it.

Use these naming habits from the start. They will save you from problems later, especially once your site is on a real web server:

  • Use lower-case letters only: about.html, not About.html.
  • Use hyphens instead of spaces: cake-menu.html, not cake menu.html.
  • Avoid special characters such as &, #, ? and apostrophes in file and folder names.

Try it: find your way around VS Code

With your bakery-site folder open in VS Code, try each of these and note what it does:

  • Click the New File icon at the top of the Explorer pane and create a file called test.html. Notice the coloured icon VS Code gives it, because it knows the extension.
  • Press Ctrl+P, type test and press Enter. This quick-open box finds any file in the folder by name.
  • Press Ctrl+B twice to hide and show the side bar.
  • Open the File menu and tick Auto Save, so your work is saved as you type.
  • Right-click test.html in the Explorer pane and delete it. You will create real files in the practical work.

Where this course goes next

You now have the map. In Module 2 you write the HTML for the bakery's landing page, in Module 3 you style it with CSS, in Module 4 you add JavaScript, and in Module 5 you publish it. Each module adds one layer to the same project, exactly as the three languages add layers to every page on the web.

Sources