Part 3 · Code and data

HTML and CSS

What a web page is made of.

What it is

Every web page is HTML and CSS. HTML says what is on the page: a title, a paragraph, a link, a picture. CSS says how it looks: colors, fonts, spacing, and the layout on a phone. The server sends both to your browser, and your browser paints the page.

Try it

A short news article. Try these steps:

  1. Tap Inspect. The HTML of the article shows next to it. Tap a tag, and its part of the page lights up.
  2. Change the headline to “You won the lottery”. The page changes at once.
  3. Move the slider for the text size and pick a color: this is CSS.
  4. Tap “Reload”. The original article comes back.
dailyexample.news/city/new-park

A new park opens by the river

City news · 2 min read

The city opened a new park by the river on Saturday. It has 300 new trees, a playground and a long path for walks and bikes.

The park is open every day from 7 in the morning. See the opening hours

Try it on any site: right-click, then Inspect.

In a meeting

Ask: “Is this a frontend change or a backend change?” A wrong color or a small text is usually CSS: a quick fix. A wrong price or a missing email comes from the backend, and it can take longer.

Where it is on the journey

One visit to a website, in 8 steps. The lit steps are where HTML and CSS work.

The request goes out

  1. Youtype an address
  2. Browsersends the request
  3. ISPcarries it on the internet
  4. Name serverfinds the IP address
  5. Server / web servergets the request, sends the answer (this term)sends HTML + CSS

The answer comes back

  1. Code (PHP)builds the answer
  2. Databasegives the data
  3. Browsergets the answer and shows the page (this term)paints the page

The server's answer is HTML and CSS. Your browser reads them and paints the page on your screen.