Book a free demo

Web Developer Path ยท lesson 1 of 18

How the web works and your first HTML page

Understand what happens when you open a web page, then build one yourself: the page skeleton, a title, a heading, a line break and a comment.

What you will learn

  • the difference between the internet and the web, and what HTTP and HTTPS do
  • what HTML is and what a tag is
  • the five parts every page needs: <!DOCTYPE html>, <html>, <head>, <title> and <body>
  • line breaks with <br> and comments with <!-- -->

Understand the idea

The internet is the worldwide network of connected computers. The web is one of the things that runs on it: pages that you ask for with an address or a link. When you type an address, your browser sends a request to a server using HTTP, or HTTPS, the secure version that shows a padlock. The server answers by sending back a file, and for a web page that file is written in HTML.

HTML stands for HyperText Markup Language. It does not make decisions like a program does. Instead it labels content: this part is a heading, this part is a paragraph, this part is a list. The labels are called tags and are written in angle brackets. Most tags come in pairs, an opening tag such as <h1> and a closing tag with a slash such as </h1>, and whatever sits between them is the content.

Every page has the same skeleton. <!DOCTYPE html> tells the browser that this is modern HTML. <html> wraps the whole page. Inside it, <head> holds information about the page, for example its <title>, which is the name shown on the browser tab. <body> holds everything people actually see. Two small extras are worth knowing now: <br> ends a line and has no closing tag, and <!-- text --> is a comment that the browser ignores, useful for notes to yourself.

You can write HTML in any plain text editor and open the saved file in a browser. Many developers use a free editor such as Visual Studio Code and keep every version of their work safe with Git. In this course the editor is built into the page, so you can start straight away.

Example

A complete first page
<!DOCTYPE html>
<html>
  <head>
    <title>My first page</title>
  </head>
  <body>
    <!-- This is a comment: the browser skips it -->
    <h1>Hello, web!</h1>
    Line one<br>
    Line two
  </body>
</html>

The title appears on the browser tab, the heading is shown on the page, and <br> starts a new line.

Your turn: code to type and practise

Complete the page: give it the title My page, put an h1 heading inside the body, add two lines of text separated by <br>, and add an HTML comment.

Stretch challenge

Change the title and heading to your own name, then add a second line break.

โ† All lessonsElements, attributes and text formatting โ†’

HTML

More in this module

Keep going in Web Developer Path

Practise the idea

๐ŸŽจ Play HTML & CSS Lab

Edit a safe sample web page and change its styles in a live preview.

Play now

FAQ

How the web works and your first HTML page: common questions

What is the difference between the internet and the web?

The internet is the global network of connected computers and cables. The web is a service on top of it made of pages and links that you open in a browser. Email and online games also use the internet but are not the web.

What does HTML stand for?

HyperText Markup Language. Hypertext means text with links, and markup means labelling content with tags.

Do I need to install anything to write HTML?

No. A plain text editor and a browser are enough, and in this course the editor and a live preview are on the page.

I am stuck. What can I do?

Press Hint for a nudge, read the message next to each goal, and compare your code with the lesson text. If you still need it, Show answer reveals a model solution. Try to type it yourself rather than copy it.

Does my work get saved?

Your ticks and XP are saved in this browser, and in your account if you log in. The code you type is not stored on a server.

Start a conversation

Enjoying coding? Meet a teacher.

Tell us the learner's age, country and what they would like to build, and we will suggest a class. A parent or guardian can make the enquiry.

  • Tell us the learnerโ€™s age or grade and goals
  • Weโ€™ll suggest a suitable class or learning path
  • Weโ€™ll confirm format, timing and fees with a parent or guardian

For a childโ€™s class, please have a parent or guardian send the enquiry. Avoid sharing passwords or sensitive personal details.

Weโ€™ll use your details only to respond to this request.

Play it, don't just read it

Write some code right now

Free games that need no sign-up. Pick one and play for five minutes.

All free games โ†’
Chat on WhatsApp
Esc

Try