Module 3 · Servers and Web Hosting

HTML page: markup, style and program

Lesson 8 of 10 8 min lesson Updated on October 30, 2026
Progress in the course80%

In this lesson

A page is text with markup.

A page has three layers: markup (HTML), style (CSS) and program (JavaScript). At the end, you write your first file.

The three layers

Think of a house. HTML is the structure: walls, doors, windows. CSS is the paint and the decoration. JavaScript is the wiring: it makes things move.

HTML is a markup language. Each piece of text gets a name: heading, paragraph, list, link. Tim Berners-Lee's list of tags, from 1992, already worked this way. "HTML5" is just a marketing name, and there is no "HTML6" to wait for.

CSS takes care of color, size and font. A rule has a selector, a property and a value: h1 { color: #2D4A7C; } gives every main heading that color. When the browser, the person reading and the author disagree, the "cascade" decides who wins.

By default, CSS blocks the page from being painted until it is ready, so nobody sees the page "naked" for an instant.

JavaScript is the program. It was created by Brendan Eich in 1995, and today it runs on 98.9% of sites, according to W3Techs.

What the pros know

The browser does not show the HTML file the way it arrived. It reads the file and builds a tree of objects in memory, the DOM. JavaScript changes that tree, not the file. That is why, when a program changes a piece of text, the original HTML (Ctrl+U) stays the same and the DOM becomes different. In Chrome's tools, right-click the element, choose Inspect, and the Elements tab shows the current tree. People who debug sites look at the tree, because the tree is what the visitor sees.

Working in every browser

The three engines from lesson 4 follow the same standard, but they implement it at different paces. That is why Interop exists: a yearly project run by the companies that make browsers, with tests and a public dashboard. "It works in Chrome" does not mean "it works". People who build pages test in all three.

Measure instead of guessing

Google publishes three measurements of user experience, the Web Vitals. PageSpeed Insights measures all three, for free, on any public address.

MeasurementWhat it measuresGood limit
LCPWhen the largest block appearsUp to 2.5 s
INPTime to respond to a tapUp to 200 ms
CLSHow much the content jumpsUp to 0.1

Accessibility: the alt attribute

The WCAG 2.2 standard requires alternative text for every image that carries information. Brazil's Inclusion Law, the Lei Brasileira de Inclusão (article 63), makes accessibility mandatory on the sites of companies with headquarters or representation in Brazil. In February 2026, WebAIM found images with no alternative text on 53.1% of one million home pages. Write what the image shows: "Bakery logo: a loaf of bread on a blue background".

Your first file

Copy this into a plain text editor, save it as mysite.html and open it in the browser.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>My first page</title>
</head>
<body>
  <h1>My first page</h1>
  <p>Written by hand and opened in the browser.</p>
</body>
</html>

Practice · 5 min

  1. Create the file mysite.html with the code above and open it in the browser.
  2. Press F12, find the heading in the Elements tab and edit the text. Check with Ctrl+U that the source code has not changed.
  3. Paste the address of a site you use into PageSpeed Insights and write down LCP, INP and CLS on mobile.

Summary

Sources

Read on October 30, 2026.

  1. WHATWG. HTML Living Standard and DOM Living Standard.
  2. Tim Berners-Lee. HTML Tags (1992).
  3. Brendan Eich. Popularity, on the creation of JavaScript.
  4. WebAIM. The WebAIM Million 2026, and Google, Interop 2026.
  5. W3Techs. Client-side JavaScript.
  6. Google. DOM in DevTools and Chrome shortcuts (Ctrl+U).
  7. Google. Web Vitals and DevTools shortcuts.
  8. W3C, WCAG 2.2, criterion 1.1.1, and Brazil, Lei 13.146/2015, art. 63.

Lesson quiz

Three situations to apply what you learned.

Lesson 8 of 10

Before moving on to the next lesson

Put what you saw into practice. The boxes stay checked in this browser, so you can come back later.

Have a question about this lesson? The IV Help team answers personally on WhatsApp.

Ask on WhatsApp