edubun
English
1 / 15

1 / 10 · Intro

What a web page is

Every page you open starts as a plain text file. Right-click almost any page, choose View Page Source, and you can read the HTML the server sent.

Jump to the 12 practice questions

You will learn

  • Picture the DOM tree the browser builds

1Explain

A page is a text file

A web page is a text file written in HTML that a browser reads and draws on screen. When you type an address into a browser, the browser asks a server for a file and gets back plain text. That text is written in HTML, the HyperText Markup Language. The browser reads it from top to bottom, works out which parts are headings, paragraphs, links and pictures, and then draws the page you see.

Change the words in the editor: the preview redraws the page the way a browser would.

Your code
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Corner Bakery</title>
  </head>
  <body>
    <h1>Corner Bakery</h1>
    <p>Fresh bread every morning from 7 am.</p>
  </body>
</html>
Preview

2Explain

Web, website, web page

These words are often mixed up. A web page is one document that a browser can display, written in HTML. A website is a collection of linked web pages that share one domain name, such as bakery.example. A web server is a computer that stores websites and sends their files to a browser that asks for them; one server can host many websites. The web is all of these pages and sites, linked together across the internet.

Definitions follow MDN Learn, “Browsing the web”.

3Problem

One site, three pages

The bakery has a home page, a menu page and a contact page, all at bakery.example. Which description is right?

Hint

Pages that share one domain name belong to one site.

Solution

Answer: 1 website with 3 web pages

Each HTML document is a web page; together, under bakery.example, they make one website.

4Problem

Sending or drawing

You open bakery.example/menu.html. Which one turns the HTML into the page you see?

Hint

One side sends the file, the other side reads it.

Solution

Answer: The browser

The web server only sends the file. The browser reads the HTML, builds the tree and draws the page.

5Explain

The skeleton, part by part

Inside <html> there are two parts. The <head> holds information about the page that is not drawn in the page itself. <meta charset="utf-8"> says which character encoding the file uses; UTF-8 can store the letters of every writing system, Korean included, so text will not turn into strange symbols. The <title> is the name shown on the browser tab, in bookmarks and in search results, and it is the first thing a screen reader announces when the page opens.

PartWhat it does
<!DOCTYPE html>Tells the browser to use standards mode
<html lang="en">Wraps the whole page and names its language
<head>Holds information about the page
<title>Sets the name on the browser tab
<body>Holds everything shown on screen

6Problem

Where visible content goes

Where does content that appears on screen go?

Hint

One part of the page holds information about it; the other holds what is drawn.

Solution

Answer: body

Everything visible belongs in body. head holds information about the page.

7Explore

What goes in body

Only what is inside body is drawn. The title in head appears on the browser tab, not on the page.

Tap a choice: the code and the preview change together.

Inside body
<!DOCTYPE html>
<html lang="en">
<head><meta charset="utf-8"><title>Corner Bakery</title></head>
<body>
  <h1>Corner Bakery</h1>
  <p>Fresh bread every morning.</p>
</body>
</html>
Preview

8Problem

The name on the tab

Which element sets the name shown on the browser tab?

Hint

It sits in head and is not drawn on the page.

Solution

Answer: title

The title element, placed inside head, names the tab, bookmarks and search results.

9Explain

From text to a tree

The browser does not keep your HTML as one long string. The browser turns HTML into a family tree called the DOM, the Document Object Model. Each element is a point in the tree, called a node, and an element inside another becomes its child. In the figure below, title is a child of head, and h1 and p are children of body. CSS selectors and JavaScript both work on this tree, which is one reason careful nesting matters.

The DOM tree of the bakery page. Lines join each element to the element that contains it.

10Problem

What the DOM is

What is the DOM?

Hint

It is what the browser builds from your HTML.

Solution

Answer: The tree of objects built from the HTML

Each element becomes a node and nested elements become its children, which is how CSS and JavaScript pick out any part of the page.

11Problem

The parent of title

In the bakery page, what is the parent of the title element?

Hint

Which element contains title in the skeleton?

Solution

Answer: head

title is written inside head, so head is its parent in the tree.

12Problem

Nodes under body

<body>
  <h1>Corner Bakery</h1>
  <p>Fresh bread every morning.</p>
  <p>
    <strong>Daily from 7 am.</strong>
  </p>
</body>

How many elements are inside body in this code? Count the nested ones too.

Hint

h1 and the two p elements are children of body; look inside the second p as well.

Solution

Answer: 4

h1, p, p and strong: 4 elements. strong is a child of the second p, so it is a grandchild of body.

13Practice

Finish the skeleton

Finish the skeleton: add lang="en" to <html>, a <title> that says Corner Bakery, an <h1> with the same words, and one paragraph.

Checks
  • lang="en" on html
  • title in head
  • h1 heading
  • a paragraph
Your code
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
  </head>
  <body>

  </body>
</html>
Preview
Hint

lang goes inside the html start tag; title goes in head; h1 and p go in body.

A solution
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Corner Bakery</title>
  </head>
  <body>
    <h1>Corner Bakery</h1>
    <p>Fresh bread every morning.</p>
  </body>
</html>

14Explain

Common mistakes

Browsers are forgiving. If you forget a closing tag, the parser follows repair rules written into the HTML standard and still builds a tree, but the repaired tree may not be the one you meant. Getting into the habit of writing the structure correctly saves a lot of puzzled debugging later.

Mistake
<p>Open <b>daily</p>
<p>from 7 am</b></p>
Fixed
<p>Open <b>daily</b></p>
<p>from 7 am</p>

The browser repairs the overlapping tags in its own way, and the bold leaks into the second paragraph. Close tags in the reverse order you opened them.

15

Summary

  • A web page is a text file of HTML that the browser turns into a tree (the DOM).
  • Skeleton: DOCTYPE, html with lang, head (meta charset, title), body.
  • HTML labels meaning; CSS styles it; JavaScript adds behaviour.

Next unitTags and elements
Full text · The whole lesson as one text

A page is a text file

A web page is a text file written in HTML that a browser reads and draws on screen. When you type an address into a browser, the browser asks a server for a file and gets back plain text. That text is written in HTML, the HyperText Markup Language. The browser reads it from top to bottom, works out which parts are headings, paragraphs, links and pictures, and then draws the page you see. You can check this on almost any site: right-click the page and choose View Page Source. Behind the colors and the layout there is a long, readable text file.

HTML is a markup language, not a programming language. It has no loops and does no arithmetic. Its job is to label content: this line is the main heading, these three lines are a list, this phrase links to another page. Two other languages usually travel with it. CSS decides how things look (colors, fonts, spacing, layout), and JavaScript makes the page react to clicks and typing. This course covers the first layer. The CSS course covers the second.

The skeleton every page shares

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Corner Bakery</title>
  </head>
  <body>
    <h1>Corner Bakery</h1>
    <p>Fresh bread every morning from 7 am.</p>
  </body>
</html>
A complete, valid HTML page. Everything visible sits inside body.

The first line, <!DOCTYPE html>, is a leftover from the early web. Its only job today is to tell the browser to use standards mode instead of an old compatibility mode that copies the bugs of 1990s browsers, so always keep it. Next comes the <html> element, which wraps the whole document. Its lang attribute names the language of the page. Screen readers use it to pick the right pronunciation, and translation tools use it to know what they are translating.

Inside <html> there are two parts. The <head> holds information about the page that is not drawn in the page itself. <meta charset="utf-8"> says which character encoding the file uses; UTF-8 can store the letters of every writing system, Korean included, so text will not turn into strange symbols. The <title> is the name shown on the browser tab, in bookmarks and in search results, and it is the first thing a screen reader announces when the page opens. The <body> holds everything that appears on screen.

The skeleton, part by part

PartWhat it does
<!DOCTYPE html>Tells the browser to use standards mode
<html lang="en">Wraps the whole page and names its language
<head>Holds information about the page
<title>Sets the name on the browser tab
<body>Holds everything shown on screen

From text to a tree

The browser does not keep your HTML as one long string. The browser turns HTML into a family tree called the DOM, the Document Object Model. Each element is a point in the tree, called a node, and an element inside another becomes its child. In the figure below, title is a child of head, and h1 and p are children of body. CSS selectors and JavaScript both work on this tree, which is one reason careful nesting matters.

The DOM tree of the bakery page. Lines join each element to the element that contains it.

Browsers are forgiving. If you forget a closing tag, the parser follows repair rules written into the HTML standard and still builds a tree, but the repaired tree may not be the one you meant. Getting into the habit of writing the structure correctly saves a lot of puzzled debugging later.

Who writes the rules

Tim Berners-Lee wrote the first proposal for the World Wide Web in March 1989 while working at CERN, and by the end of 1990 the first web server and browser were running there. HTML has grown a great deal since then. Today it is defined by the HTML Living Standard, maintained by the WHATWG, a group set up by browser makers. In 2019 the W3C and the WHATWG agreed to work on this single version. Living means the document has no version numbers and is updated continuously, so the name HTML5 that you will still see in books is only a loose label.

The editor below works like a tiny browser. Type on the left and the result appears on the right a moment later. Play redraws the result at once. When you think you are done, press Check: the page runs a few tests on your HTML and tells you which ones still fail. Start over brings back the starting code.

Key points
  • A web page is a text file of HTML that the browser turns into a tree (the DOM).
  • Skeleton: DOCTYPE, html with lang, head (meta charset, title), body.
  • HTML labels meaning; CSS styles it; JavaScript adds behaviour.

Practice questions from What a web page is on edubun

Embed this quiz

Free to embed. Please keep the credit line.

Sources for this course (9)
  • WHATWG, HTML Living Standard (html.spec.whatwg.org, checked 2026-10-17)
  • MDN Web Docs, Learn web development: Structuring content with HTML, and the HTML element reference (developer.mozilla.org/en-US/docs/Learn_web_development/Core/Structuring_content and developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements, checked 2026-10-17)
  • MDN, HTML images (alt text guidance, checked 2026-10-17)
  • W3C WAI, Images tutorial and alt decision tree (w3.org/WAI/tutorials/images/decision-tree, checked 2026-10-17)
  • CERN, A short history of the Web (home.cern/science/computing/the-birth-of-the-web/short-history-web/, checked 2026-10-17)
  • W3C and WHATWG memorandum of understanding, 28 May 2019 (w3.org/2019/04/WHATWG-W3C-MOU.html, checked 2026-10-17)
  • W3C, Using ARIA, first rule of ARIA use (w3.org/TR/using-aria/, checked 2026-10-17)
  • W3C Markup Validation Service (validator.w3.org, checked 2026-10-17)
  • MDN, Viewport meta element (checked 2026-10-17).

Checked: 2026-10-17