Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR ANGULARJS GIT POSTGRESQL MONGODB ASP AI R GO KOTLIN SWIFT SASS VUE GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING BASH RUST

Brtest Tutorial


How the Web Works

Before we start coding, it's important to understand what happens behind the scenes when you visit a website. When you type a web address (like www.w3schools.com) and press Enter, your browser, the internet, and a web server all work together to display the page.

Note: Learning how the web works will help you understand what your code actually does when you build a website.


Clients and Servers

Every website needs two main parts:

  • Client: The web browser (like Chrome, Edge, or Firefox) that requests and displays web pages.
  • Server: A computer that stores and serves the website’s files (HTML, CSS, JavaScript, images, etc.).

Example

Client-server communication:

Browser (Client) → sends HTTP request → Web Server
Web Server → sends HTML, CSS, and JS → Browser
Browser → displays the page to the user

Tip: The word HTTP stands for HyperText Transfer Protocol — the set of rules that makes this communication work.


What Happens When You Visit a Website

  1. You type a web address (URL) into your browser.
  2. The browser contacts a DNS server to find the website’s IP address.
  3. The browser sends an HTTP request to that server.
  4. The server finds the requested page and sends back HTML, CSS, and JavaScript files.
  5. Your browser reads those files and renders the web page on screen.

Example

1. You type: https://example.com
2. Browser → Server: "Give me index.html"
3. Server → Browser: Sends HTML, CSS, and JS files
4. Browser → Displays the page to you!

HTTP vs HTTPS

When you visit a site that starts with https://, the “S” means the connection is secure and encrypted. This protects your information while it travels between your computer and the website’s server.

Example

http://example.com → Not encrypted
https://example.com → Encrypted and secure

Tip: Always use HTTPS for your own websites — it’s required by most browsers for modern features like geolocation or service workers.


View Source: See the Code Behind Any Page

Every web page you visit is made of HTML, CSS, and JavaScript. You can view this code directly in your browser.

  1. Right-click anywhere on a page.
  2. Select View Page Source or Inspect.
  3. You will see the underlying HTML that structures the page.

Example

Try viewing the source of this simple page:

<!DOCTYPE html>
<html>
<head><title>View Source Demo</title></head>
<body>
  <h1>Welcome to My Page</h1>
  <p>Right-click and select "View Page Source" to see this code.</p>
</body>
</html>
Try it Yourself »

Summary

  • The browser (client) requests web pages from a server.
  • The server sends back files (HTML, CSS, JS) via HTTP or HTTPS.
  • Your browser interprets those files and displays a website.
  • Every website you visit is made of HTML, CSS, and JavaScript working together.

Next, you’ll learn about the difference between the frontend (what users see) and the backend (what happens on the server).

Next » Frontend vs Backend

×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookies and privacy policy.

Copyright 1999-2025 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.