Every day you type a web address, press Enter, and a page appears in less than a second. It feels like magic, but it is a chain of small, logical steps. If you want to learn web design or programming, understanding how the web works is the best place to start.
In this beginner guide you will learn what browsers and servers do, how a web address turns into a page, and how HTML, CSS and JavaScript work together to build the websites you use every day.
What You Will Learn
- What the web actually is
- Clients and servers
- What a web browser does
- Domain names and DNS
- HTTP and HTTPS
- What happens when you open a website
- HTML, CSS and JavaScript explained
- Front end and back end
- Try it yourself: build your first page
- Frequently asked questions
What Is the Web?
The internet is the huge global network of connected computers. The web (short for World Wide Web) is one service that runs on top of that network. It is a collection of pages, images, videos and apps that you access using a browser.
Email, online games and video calls also use the internet, but they are not the web. When you visit a website, you are using the web.
Clients and Servers: The Basic Idea
The web works on a simple model. One side asks for something, and the other side provides it.
- The client is your device and its browser. It asks for a web page.
- The server is a powerful computer, always switched on and connected to the internet, that stores website files and sends them back when asked.
Think of a restaurant. You are the customer (client), you place an order, and the kitchen (server) prepares it and sends it to your table. If the kitchen does not have what you ordered, you get an error message instead, such as the famous 404 Not Found.
What Does a Web Browser Do?
A web browser is software that requests web pages, receives the code, and turns that code into the visual page you see. Popular browsers include Chrome, Safari, Firefox and Edge.
A browser has three main jobs:
- Send requests to servers for pages, images and other files.
- Read the code that comes back (HTML, CSS and JavaScript).
- Display the result on your screen and respond when you click, tap or type.
Domain Names and DNS
Computers find each other using numbers called IP addresses, but people prefer names. A domain name is the readable address you type, such as example.com.
DNS (Domain Name System) works like a phone book. When you type a domain name, your browser asks a DNS server, "Which IP address belongs to this name?" The DNS server replies with the number, and now your browser knows where to send its request.
HTTP and HTTPS: The Language of the Web
Browsers and servers need a shared language to talk to each other. That language is HTTP (HyperText Transfer Protocol).
- The browser sends an HTTP request, such as "Please send me the home page."
- The server sends an HTTP response containing the page, plus a status code that says how it went. Code 200 means success, 404 means the page was not found, and 500 means the server had a problem.
HTTPS is the secure version. It encrypts the conversation so nobody can spy on passwords, card details or personal information. Look for the padlock icon in your browser. For SEO and user trust, every modern website should use HTTPS.
What Happens When You Open a Website?
Here is the full journey, step by step, from typing an address to seeing a page:
- You type a URL into your browser and press Enter.
- The browser checks DNS to find the IP address of the server.
- The browser sends an HTTP request to that server.
- The server processes the request. It may simply return a stored file, or it may run code and fetch information from a database first.
- The server sends back a response containing HTML, and usually CSS, JavaScript and images too.
- The browser reads the HTML and builds the page structure. As it finds links to CSS, JavaScript and images, it requests those files as well.
- The browser displays the page and runs the JavaScript so the page can react to you.
All of this usually happens in a fraction of a second.
HTML, CSS and JavaScript Explained
Almost every website is built from these three technologies. A house makes a good comparison.
HTML: The Structure
HTML (HyperText Markup Language) defines what is on the page: headings, paragraphs, images, links, buttons and forms. It is the frame and walls of the house.
<h1>Welcome to My Website</h1>
<p>This is a paragraph of text.</p>
<a href="/about">About me</a>CSS: The Style
CSS (Cascading Style Sheets) controls how the page looks: colors, fonts, spacing and layout. It is the paint, furniture and decoration.
h1 {
color: teal;
}
p {
font: 18px Arial;
}JavaScript: The Behavior
JavaScript makes the page interactive. It handles menus that open, forms that check your input, live search suggestions and content that updates without reloading. It is the electricity and plumbing that make the house work.
document.querySelector("button").addEventListener("click", function () {
alert("You clicked the button!");
});| Technology | Role | Simple analogy |
|---|---|---|
| HTML | Structure and content | The frame of a house |
| CSS | Design and layout | Paint and decoration |
| JavaScript | Interaction and logic | Electricity and plumbing |
Front End and Back End
Web development is usually split into two sides.
- Front end is everything the visitor sees and touches in the browser. It is built with HTML, CSS and JavaScript.
- Back end is the work that happens on the server: handling logins, saving data to a database, processing payments and sending the right content back. Common back end languages include PHP, Python, JavaScript (Node.js), Java and Ruby.
A developer who works on both sides is called a full stack developer.
Try It Yourself: Build Your First Web Page
You do not need special software. A text editor and a browser are enough.
- Create a new folder on your computer.
- Inside it, create a file named index.html.
- Paste in the code below and save the file.
- Double click the file to open it in your browser.
<!DOCTYPE html>
<html lang="en">
<head>
<title>My First Web Page</title>
<style>
body { font: 18px Arial; background: #f5f5f5; padding: 40px; }
h1 { color: teal; }
button { padding: 10px 20px; font: 16px Arial; }
</style>
</head>
<body>
<h1>Hello, Web!</h1>
<p>I just built my first web page.</p>
<button>Click me</button>
<script>
document.querySelector("button").addEventListener("click", function () {
document.querySelector("h1").textContent = "You clicked the button!";
});
</script>
</body>
</html>You just used all three technologies together. HTML created the content, CSS styled it, and JavaScript changed the heading when you clicked. Try changing the colors, the text and the message to see what happens.
Frequently Asked Questions
What is the difference between the internet and the web?
The internet is the global network of connected computers. The web is a service on that network made of websites and pages that you view in a browser.
Do I need to know all three languages to build a website?
To build a basic website, start with HTML and CSS. Add JavaScript when you want interactivity, and a back end language when you need logins, databases or payments.
What is a web server?
A web server is a computer (and the software on it) that stores website files and sends them to browsers when they are requested.
Why is my website slow?
Common causes are large images, too many files, cheap or overloaded hosting, and unoptimized code. We will cover performance in a later tutorial.
Is HTML a programming language?
HTML is a markup language, not a programming language, because it describes structure rather than logic. JavaScript and PHP are programming languages.
Key Takeaways
- The web runs on a client and server model: browsers ask, servers answer.
- DNS turns domain names into IP addresses.
- HTTP and HTTPS are the rules browsers and servers use to communicate.
- HTML gives structure, CSS gives style, and JavaScript gives behavior.
- The front end is what users see, and the back end is the work done on the server.
What to Learn Next
Now that you understand the big picture, the next step is writing clean markup. In next week's tutorial, we cover Semantic HTML and Accessibility, and show you how to write pages that search engines and screen readers understand.
Found this helpful? Share it with a friend who is starting their coding journey, and leave a comment with any questions.
Hit me with a comment!