freecourses.digital
Lesson progress: 0 of 3 activities done
All lessons in HTML Basics for Beginners Lesson 1.2 of 34

Module 10: Practice Project and Validation

  1. 10.1Build a simple HTML website

How websites work: HTML, CSS, and JavaScript

Covered here

  • What happens when you type a website address
  • The job of HTML, CSS, and JavaScript
  • The house analogy for the three front-end languages
  • Which one to learn first and why

Short answer

A website is a set of files stored on a web server. When you visit it, your browser requests those files and builds the page. HTML gives the page its structure, CSS controls how it looks, and JavaScript makes it interactive. These three are called front-end languages because they run in the browser, on the visitor's side.

What happens when you visit a website

  1. You type freecourses.digital in the address bar.
  2. DNS, the internet’s phone book, turns that domain name into an IP address of a server.
  3. Your browser sends an HTTP request to that web server.
  4. The server sends back an HTML file, plus CSS, JavaScript, and images.
  5. The browser renders everything into the page you see.

All of this happens in about one to two seconds on a good connection.

Three languages, three jobs

LanguageJobExample
HTMLStructure and meaningThis is a heading, this is a button
CSSStyle and layoutThe heading is blue, the button is rounded
JavaScriptBehaviorClicking the button opens a menu

Think of building a house. HTML is the frame: walls, rooms, doors. CSS is the paint, tiles, and furniture. JavaScript is the electricity: lights that switch on, a gate that opens.

See them working together

<button class="order">Order now</button>

<style>
  .order { background: green; color: white; }
</style>

<script>
  document.querySelector(".order").onclick = () => alert("Salamat!");
</script>

The HTML creates the button. The CSS paints it green. The JavaScript shows a message when someone clicks.

Front end vs back end

The front end is what runs in the visitor’s browser: HTML, CSS, JavaScript. The back end runs on the server: languages like PHP, Python, or Node.js, plus a database. WordPress, for example, uses PHP on the back end to generate HTML for the front end.

No matter which back end a site uses, the browser always receives HTML in the end. That is why HTML is the first skill to learn.

Try it: add style

The HTML is already here. Change the color value in the style block, for example from teal to crimson, and watch the heading change.

Live preview

Quick quiz

1. Which language controls how a page looks?
2. Which language adds interactivity like menus that open?
3. What does DNS do?
4. Which language does a browser always receive, even from a WordPress site?

Common mistakes

  • Styling with HTML tags. Old tags like <font> and <center> are obsolete. Use CSS for looks.
  • Starting with JavaScript frameworks. React and Vue are easier once you know plain HTML and CSS.
  • Mixing up front end and back end. HTML, CSS, and JavaScript run in the browser. PHP and databases run on the server.

Your action

Tick each item when you can do it. Your progress saves on this device.

Key terms

Web server
A computer that stores website files and sends them to browsers.
Domain name
A readable website address, like freecourses.digital.
DNS
Domain Name System, which turns domain names into IP addresses.
HTTP request
The message a browser sends to ask a server for a file.
CSS
Cascading Style Sheets, the language for styling HTML.
JavaScript
The programming language that makes pages interactive.
Front end
The part of a website that runs in the visitor's browser.

Questions beginners ask

Should I learn HTML and CSS together?

Learn HTML first for a week or two, then add CSS. They work as a pair, but structure comes first.

Is WordPress HTML?

WordPress is a content management system written in PHP. It outputs HTML to the browser, and you can edit HTML in its block editor.

Do I need JavaScript for a simple website?

No. A business page with text, images, links, and a contact form works with HTML and CSS alone.

What is a static website?

A static website is a set of ready-made HTML files served as they are, without a database. It is fast and cheap to host.

Related lessons

Need a website built or fixed while you practice? The team at Remar Digital can help.