How the Web Works

Find out what happens between typing a web address and seeing a page. Learn how browsers and servers talk through HTTP requests and responses, how to read URLs, domain names and status codes, and what HTML, CSS and JavaScript each contribute to a page. Set up a code editor and use your browser's developer tools to inspect elements, read errors and follow every request a page makes.

BeginnerLesson 1 of 8 in Web Development Basics Course

What you will learn

  1. Explain the roles of clients and servers, and follow the main steps from typing a web address to seeing a finished page, including where each step can go wrong.
    • Explain clients, servers and the request–response cycle
      Describe what clients and servers are, how a browser asks a server for files, and why one page usually takes many requests.
    • Follow the steps from address bar to finished page
      Put the main steps in order (reading the address, finding the server, sending the request, receiving the response and building the page) and say what goes wrong at each step.
  2. Take a web address apart, explain what each part tells the browser and the server, read domain names correctly, and write working links between the files of a site.
    • Name the parts of a URL
      Identify the scheme, host, port, path, query string and fragment of a web address and explain what each one does.
    • Read domain names and explain how they lead to a server
      Split a domain name into its labels, tell who controls a domain, and describe how a name is registered and linked to a server's address.
    • Write absolute and relative links between files
      Choose between absolute, relative and root-relative addresses, work out where a relative link leads, and name files so links keep working on a server.
  3. Describe what a browser sends to a server and what comes back, and use status codes to tell whether a request worked and, if not, where the problem lies.
    • Describe what an HTTP request contains
      Read the parts of an HTTP request, choose between GET and POST, and explain what the common request headers tell the server.
    • Describe what an HTTP response contains
      Read a response's status line, headers and body, explain media types, and describe how cookies and caching work on top of a stateless protocol.
    • Interpret status codes and diagnose failed requests
      Sort status codes into their five classes, explain the codes you meet most often, and use them to decide whether a problem lies with the request, the server or neither.
  4. Say what each of the three languages of the web does, how they connect in one page, and how the browser turns the files it receives into a page you can see and use.
    • Tell apart structure, presentation and behavior
      Recognize HTML, CSS and JavaScript code, explain the job of each, and show how a page links them together.
    • Explain how the browser builds a page from its files
      Describe how the browser turns HTML into the DOM, applies CSS, runs scripts and draws the page, and explain why view source and the live page can differ.
  5. Prepare a code editor and project folder, preview pages locally, and use the browser's developer tools to inspect elements and styles, read errors and follow every request a page makes.
    • Set up a code editor and a project folder
      Install and configure a code editor, organize a site's files in a project folder, and preview pages from disk or through a local server.
    • Inspect elements, styles and errors with developer tools
      Open the developer tools, inspect and temporarily edit HTML and CSS, read console errors, and preview a page at phone width.
    • Follow every request in the Network panel
      Record a page load, read each request's status, type, size and headers, and use the panel to find broken links, redirects and caching effects.

How the Web Works study guide

5 chapters

1

From your browser to a web server

Opening a page starts a conversation between your browser and one or more servers. Follow that conversation from the first address to the files that fill your screen. Seeing the steps separately helps you explain why text can appear before images, why a second visit may load faster, and why a missing file produces a different kind of failure from a server that cannot be reached.

1.1 Clients, servers, and separate resources

A web page on your screen is the result of work in two places. Your browser asks for resources, and a server sends responses. Those roles explain both a simple personal site and a page assembled from several services.

Who asks and who answers

A client is a device and program that requests something. Chrome, Edge, Firefox, and Safari are browser clients. A server is a computer running software that accepts requests and sends back stored files or content it produces. Apache and nginx are examples of web server software. The word "server" can name the computer or that software.

In an HTTP exchange, the client sends a request naming what it wants. The server sends a response to that request. Picture ordering food at a counter: the order slip asks for something, and the tray is the reply. The browser initiates the exchange; an ordinary page response answers a request.

Client and server are roles, not fixed types of machine. A laptop can run both your browser and a test server. A site is hosted when a reachable server makes its resources available. A server reached through localhost runs on your own computer; that address does not take another person's browser to your laptop.

A page is a collection of resources

A resource is something an address can identify: a page, stylesheet, script, image, font, video, or piece of data. The first page request usually retrieves HTML. The browser reads that HTML to discover the other resources it needs and requests each separately.

For example, an article names two stylesheets, one script, and five images. Count the HTML too:

  • One HTML resource starts the page.
  • Two CSS resources supply its styles.
  • One JavaScript resource supplies behavior.
  • Five image resources supply pictures.

That makes nine resources and, with an empty browser cache, nine HTTP requests for those resources. A cache stores downloaded copies for reuse. Fresh cached files can reduce the requests that travel over the network on another visit.

The resources need not share a server. The HTML might come from www.example.com, pictures from images.example.net, and a video from another service. Each resource's address tells the browser where to ask. A successful HTML request therefore does not establish that every image or script also loaded.

Stored files and generated replies
Kind of responseHow the server prepares itExample
StaticSends a stored file as it isAn about.html page
DynamicRuns a program to produce the replySearch results for a particular query

In both cases, the browser receives resources it can read or display. A generated HTML page is still HTML when it reaches the browser. The browser holds downloaded copies, while the server keeps the site's original files or the program that produces them.

The web runs over the internet

The internet is the worldwide network that carries data between computers. The web is a service using that network: linked resources addressed by URLs and exchanged through HTTP. Email, online games, and video calls also use the internet. The web is one use of the network, not the name for every activity on it.

Key Takeaways

  • An HTTP exchange starts with a client request and receives a server response.
  • A page usually needs a separate request for each resource, unless a usable cached copy is available.
  • Client and server describe roles; one computer can perform both.
  • Static files are stored replies; dynamic replies are produced by server programs.
  • The web is a service that runs over the internet.

1.2 The steps in a page load

Pressing Enter on a web address starts several tasks. Each has a different job, so a failure at one stage leaves different evidence from a failure at another.

Read the address and find the server

Take https://www.example.com/news.html. The browser reads https as the scheme, www.example.com as the host, and /news.html as the requested path. Text such as "weather tomorrow" is normally treated as a search and sent to the default search engine instead.

The browser needs an IP address, a numeric network address such as 203.0.113.10 or the IPv6 example 2001:db8::1. DNS, the Domain Name System, finds addresses associated with domain names. The browser and operating system can reuse a recent DNS answer from a cache, so every page visit does not require a new lookup.

Connect and protect the exchange

The browser connects to the server. For HTTPS, it sets up an encrypted connection using TLS. The server presents a certificate that lets the browser check its identity for the requested domain. Encryption protects the messages from being read or changed by others on the network. A secure-connection indicator describes that protection; a scam site can also have a valid certificate.

Data travels across the network in small pieces called packets, through devices called routers, and is put together at the destination. The browser and operating system handle that transport while the browser works with the HTTP messages.

Request, receive, and build
  1. The browser sends an HTTP request for /news.html.
  2. The server responds with a status code, headers describing the reply, and usually a body containing the HTML.
  3. The browser reads the HTML and requests the stylesheets, scripts, images, and other resources it names.
  4. It builds the page, applies styles, runs scripts, and draws content on screen.

Several resource requests can overlap. The browser can show text before every image finishes downloading; the page is assembled progressively.

For a small page at https://example.org/, suppose the HTML names only style.css and logo.png, both on the same host. With no relevant cached entries, one host needs a DNS lookup and the three resources need three HTTP requests. On a later visit, a cached DNS answer avoids that lookup. Fresh resource copies can be reused, and older copies can be checked with the server. A 304 Not Modified response means a stored copy is still current and the file body need not be sent again.

Locate a failure by its evidence
EvidenceStage to investigate
Name cannot be resolvedDNS could not find an address
Connection times outThe server could not be reached in time
HTTP 404 responseA server answered, but did not find the requested resource
Text appears without its stylingCheck the separate stylesheet request

A DNS failure has no HTTP status code because no HTTP response arrived. A 404 is different: the server answered. Chrome may show a name error such as DNS_PROBE_FINISHED_NXDOMAIN, but the wording is a browser message, not a server response.

Key Takeaways

  • The main order is read URL, find address, connect, request, receive, and build.
  • DNS maps names to addresses; HTTPS protects the HTTP exchange with TLS.
  • The browser can display content while other resources are still loading.
  • A DNS or connection failure can occur before any HTTP response exists.
2

Read addresses and build working links

A web address tells the browser both where to connect and what to request. Learn to separate its parts, read domain names from the right, and trace links through folders. These skills help you spot a misleading host name and fix a missing image or stylesheet. The same path rules apply when you build a small site locally and when its folder is served from a web server.

2.1 What each part of a URL does

A URL, or Uniform Resource Locator, addresses one resource. The domain name is only one part of that address. The full pattern is scheme://host:port/path?query#fragment, though many addresses leave out optional parts.

Take an address apart

Read this address in pieces:

https://shop.example.com:8443/products/shoes.html?color=blue&size=42#reviews

PartValueJob
SchemehttpsChooses encrypted HTTP
Hostshop.example.comNames the server destination
Port8443Selects a service at that destination
Path/products/shoes.htmlIdentifies the resource to request
Querycolor=blue&size=42Supplies extra input
FragmentreviewsIdentifies a location within the page

The punctuation separates parts: : follows the scheme, ? starts the query, and # starts the fragment. The separators are not part of the query or fragment values.

Scheme, host, and port

The scheme selects how the address is handled. http uses unencrypted HTTP; https uses encrypted HTTP. mailto:info@example.com asks an email program to compose a message, while file:/// addresses a local file.

The port selects a service on the host. If omitted, HTTP uses port 80 and HTTPS uses 443. Thus https://example.com/ and https://example.com:443/ identify the same destination and path. Local test servers often use ports 3000, 5500, or 8080; http://localhost:5500/ includes its port because it is not HTTP's default.

The scheme and host ignore letter case. The host www.example.com is a different name from example.com; both reach a site only when its owner has configured them that way.

Path, query, and fragment

On a simple static site, a path follows the server's folders and files. On other sites, server software decides what a path returns, so a path need not name a file on disk. A folder address ending in / often serves a default page such as index.html.

A query string carries input after ?. In /search?q=web+basics&page=2, & separates two fields: the search words and page number. These fields travel to the server as part of the request target.

A fragment stays in the browser. The suffix #reviews usually scrolls to an element with id="reviews". The browser requests the path and query without the fragment. Changing only #top to #reviews does not ask the server for a different file.

Preserve the exact characters

Web paths use forward slashes /. A space can be percent-encoded as %20. Form encoding uses + for a space and %40 for @; an ordinary URL path or query can contain a literal @, so form encoding and general URL spelling are not identical rules.

Paths may be case-sensitive even though hosts are not. /Images/Logo.png can differ from /images/logo.png. Copying the host correctly but changing a path's capital letters can still request the wrong resource.

Key Takeaways

  • A URL separates the destination from the path, query input, and browser fragment.
  • Default ports are 80 for HTTP and 443 for HTTPS.
  • The query reaches the server; the fragment does not.
  • Hosts ignore letter case, but paths may distinguish it.
  • Use forward slashes in web paths and encode spaces.
  • An address path can be handled by software without matching a stored file.

2.2 Domain names and who controls them

A domain name gives people a readable name to use in place of a numeric IP address. Its dotted parts also show how the name is organized. Reading those parts correctly matters when two addresses contain similar words.

Start at the right end

Each part between dots is a label. In blog.example.org, the rightmost label, org, is the top-level domain, or TLD. The registered domain is example.org, and blog is a subdomain controlled through that domain.

Generic TLDs include .com, .org, .net, .dev, and .shop. Country-code TLDs have two letters, such as .nl, .de, .jp, .br, and .ca. Some have eligibility rules: .gov is restricted to verified US government organizations. New institutional .edu registrations generally require eligible, institutionally accredited US postsecondary institutions; some organizations qualify under other policies, and older registrations can have exceptions. ICANN coordinates the domain name system's top-level names.

A registered name is not always just the final two labels. Under .co.uk, for example, the registered name in news.example.co.uk is example.co.uk. Read the public ending first, then identify the name registered beneath it.

Familiar words can sit inside someone else's name

Compare these hosts:

HostControlling registered domain
accounts.example.comexample.com
example.com.signin.example.netexample.net

In the second host, the words example.com are labels on the left of example.net. They do not give the owner of example.com control of the address. Identify the host before reading it from the right; a familiar name in a path is not the host either.

www is an ordinary subdomain label. A site owner can use it, omit it, or redirect between names. Its presence is not required by the web.

Registration and hosting are separate

A registrar handles domain registrations for customers. A registry maintains the records for a TLD. Registering a domain gives you the right to use that name for a term, usually one or more years. You renew it to retain that right; an expired name can eventually become available to someone else.

The owner then configures DNS records to associate the name with a hosting server's address. The domain is not the website's files. The same name can be pointed to a different server, and one server can serve several domains. Cached DNS answers explain why a changed address can take minutes or hours to be seen everywhere.

Name rules and local names

Ordinary host labels use letters, digits, and hyphens, with no hyphen at either end. Each label can have up to 63 characters, and an ordinary full name can have up to 253 characters. Names ignore letter case. Internationalized domain names support other writing systems; their encoded ASCII labels begin with xn--.

The special name localhost means the computer making the request. Its loopback addresses include 127.0.0.1 and ::1. If a learner opens http://localhost:3000/, the browser looks for a service on that learner's own computer.

Key Takeaways

  • Read domain labels from right to left to identify the registered domain and its subdomains.
  • A familiar name on the left of a different registered domain does not control that host.
  • Registration reserves a name for a renewable term; hosting makes resources available.
  • DNS connects names to server addresses, and cached answers can delay visible changes.
  • localhost addresses the computer making the request.

2.3 Paths that reach the right file

A link can contain a full address or instructions for finding a resource from the current page. To predict where it goes, start with the page's address and follow the path one part at a time.

Choose the starting point
Kind of linkExampleStarting point
Absolutehttps://example.com/images/logo.pngThe named scheme and host
Relative../images/logo.pngThe current page's folder
Root-relative/images/logo.pngThe top of the current site

An absolute URL identifies its own host and works from any page. It is useful for another website. A relative URL omits the beginning and is completed from the page's address. For files inside a site, this helps the folder move together from a laptop to a server.

Work through a folder tree

Suppose a site contains these files:

my-site/
  index.html
  about.html
  images/logo.png
  styles/main.css
  blog/first-post.html

From index.html, about.html stays in the same folder. images/logo.png enters the images subfolder, and styles/main.css enters styles.

From blog/first-post.html, the starting folder is blog. To reach the logo, use ../images/logo.png: first go up to the site folder, then enter images. The link images/logo.png would instead look inside blog/images, where this tree has no logo. To reach the home page from that post, use ../index.html.

Trace nested addresses

On https://example.com/blog/2026/post.html:

  • photo.jpg becomes https://example.com/blog/2026/photo.jpg.
  • ../index.html becomes https://example.com/blog/index.html.
  • /about.html becomes https://example.com/about.html.
  • #comments stays on this document and identifies its comments element.

A leading / replaces the current path from the site root. It does not mean "one folder up." Repeating ../ climbs multiple folder levels: ../../about.html from the nested post goes up through 2026 and blog before finding about.html.

Preview links in the right environment

A root-relative path works with an HTTP server, including a local server. On a file:/// page, / points toward the root of the computer's file system, not your project folder. Use a local server when testing this style of link.

A path such as C:\Users\sam\site\logo.png or file:///Users/sam/site/logo.png identifies a location on one computer. Other visitors do not have that folder. Link with a web path that stays inside the site's structure.

Match names exactly

Use lowercase names, hyphens instead of spaces, and correct extensions: contact-form.html is easier to link reliably than Contact Form.HTML. Windows and macOS commonly ignore filename case, while many web servers distinguish it. A local link to Logo.png can fail online when the actual name is logo.png.

A home page named index.html is a common server default. Requesting a folder such as /blog/ usually serves its index.html when that server is configured with this default.

Key Takeaways

  • Absolute links supply their own destination; relative links begin in the current page folder.
  • Each ../ climbs one folder, while a leading / starts at the site root.
  • Test root-relative links through a web server.
  • Paths and filenames must match, including letter case and extensions.
3

Read the messages and diagnose failures

Every resource request produces evidence you can inspect: the method and address sent by the browser, the response headers, and the status code. Read these parts together to tell a successful download from a redirect, a reused file, or a failure. You will also see how cookies and caching build useful features on top of separate HTTP exchanges, and why a page's appearance alone cannot tell you what its server returned.

3.1 Inside an HTTP request

HTTP, the Hypertext Transfer Protocol, defines how web clients request resources and how servers reply. HTTPS carries those messages over an encrypted connection. Reading a request shows what the browser asked the server to do.

Read the message in order

Here is a request shown in HTTP/1.1 text form:

GET /products/shoes.html?color=blue HTTP/1.1
Host: shop.example.com
Accept: text/html
Accept-Language: en-US,en;q=0.9

The first line contains the method, the request target, and the HTTP version. GET asks to retrieve a resource. The target includes the path and query; it excludes any fragment. The host appears in the Host header, which lets one server distinguish the sites it serves.

A header is a named field such as Accept: text/html that carries information about the request or its content. An empty line ends the headers. Some requests then carry a body, the data being sent. This GET example has no body.

HTTP/2 and HTTP/3 encode messages differently, but retain methods, targets, headers, and bodies. DevTools presents them in readable form, so these message parts remain useful across versions.

Choose a method for the action
MethodIntended action
GETRetrieve a resource
POSTSubmit data for processing
HEADRetrieve response headers without a body
PUTReplace a resource
PATCHChange part of a resource
DELETERemove a resource

Following a normal link or typing an HTTP address makes a GET request. An HTML form uses GET by default and POST when it specifies method="post".

With a GET form, fields go into the URL query. This suits a search whose results you want to bookmark or share. POST places submitted fields in the request body and suits actions such as creating an account or posting a comment.

POST does not encrypt anything by itself. On plain HTTP, both query data and body data can be read in transit. HTTPS protects both. Passwords belong in POST bodies over HTTPS because URLs also appear in browser history and may be stored in logs.

Read a form submission
POST /signup HTTP/1.1
Host: www.example.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 38

name=Ana+Silva&email=ana%40example.com

The target is /signup. Content-Type identifies the body's form encoding. The body contains the name "Ana Silva" and the email "ana@example.com": + decodes to a space and %40 to @. There are 38 bytes here, matching Content-Length.

Reading, repeating, and identifying requests

A safe method is intended to read without changing server state; GET, HEAD, and OPTIONS are safe. An idempotent method has the same intended effect if repeated. Safe methods, PUT, and DELETE are idempotent. POST is not guaranteed to be: repeating a submission can create a second comment or order.

Other request headers include User-Agent for client information, Accept for acceptable formats, and Accept-Language for language preferences. Cookie returns stored cookie values. Referer, with its historical spelling, can identify the referring page; browsers may omit or reduce it according to policy.

Key Takeaways

  • A request names a method and target, then supplies headers and sometimes a body.
  • GET retrieves resources; POST submits data for processing.
  • HTTPS protects messages in transit; POST alone supplies no encryption.
  • A query travels in the request target, while form POST data travels in the body.
  • Safe methods are intended to read; idempotent methods have the same intended effect when repeated.
  • HTTP versions change the encoding without removing the main message parts.

3.2 Inside an HTTP response

The response is the server's answer to one request. Its code tells you the outcome, its headers describe the reply, and its body carries the returned content when a body is allowed.

Separate the parts

A response in HTTP/1.1 text form can begin like this:

HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Content-Length: 1534
Cache-Control: max-age=600

<!DOCTYPE html>
<html lang="en">
...

The status line gives the version, code 200, and human-readable reason phrase OK. Programs use the number. HTTP/2 and HTTP/3 do not carry that reason phrase. After the headers and an empty line, the body begins with the HTML.

Content-Length describes a byte count, not a character count or a visible page size. For an image response with Content-Length: 24576, the body has 24,576 bytes: 24.576 kB, or about 24.6 kB using 1 kB = 1,000 bytes.

Identify the body by its media type

The media type, also called a MIME type, is sent in Content-Type.

Media typeTypical content
text/htmlA web page
text/cssA stylesheet
text/javascriptA script
image/png, image/jpeg, image/svg+xmlImages
application/jsonStructured data

The header tells the browser how to handle the body; a filename extension alone is not enough. If a stylesheet URL returns an HTML error page with Content-Type: text/html, the browser rejects it as CSS. This often explains a page with text but no intended styling.

Bodies can be text or binary bytes. A response to HEAD has no body, even when its headers describe the resource a GET would return. 204 No Content and 304 Not Modified also have no body.

Carry identity between separate requests

HTTP is stateless: an exchange does not automatically remember an earlier one. A cookie supplies information that connects requests to an ongoing session.

  1. The server responds with Set-Cookie: session=abc123.
  2. The browser stores the cookie.
  3. On later matching requests, it sends Cookie: session=abc123.
  4. The server can use that value to look up the session, such as the learner's login or cart.

Cookie scope and browser rules control which requests receive it.

Reuse content without downloading it again

Cache-Control: max-age=600 lets the browser treat a stored response as fresh for 600 seconds, or 10 minutes. During that period it can reuse the copy without contacting the server. After it becomes stale, the browser can ask whether it changed. A 304 means reuse the cached body; a 200 can deliver a replacement.

If saved CSS changes do not appear, check whether the browser reused a copy. A hard reload, commonly Ctrl+Shift+R on Windows/Linux or Cmd+Shift+R on macOS, or DevTools' Disable cache option helps fetch fresh resources. That checkbox applies while DevTools is open.

Other useful response headers include Location for a redirect destination, Date for the response date, and Server for server software information when supplied.

Key Takeaways

  • The status describes the outcome; headers describe the response; the body carries content.
  • Content-Type identifies the body format, and Content-Length counts bytes.
  • HEAD, 204, and 304 responses have no body.
  • Set-Cookie stores a cookie; later Cookie headers return it on matching requests.
  • A fresh cached response can be reused; 304 validates a stored body.

3.3 Status codes as troubleshooting evidence

A status code is the three-digit outcome in an HTTP response. The number describes one request, so one page can have successful HTML, a missing image, and a redirected script at the same time.

Start with the first digit
ClassMeaning
1xxInformational, usually an interim message
2xxSuccess
3xxRedirection, including cache validation
4xxThe request cannot be fulfilled as sent
5xxA server failed to fulfill the request

200 OK is the usual successful GET. 201 Created reports creation of a new resource, often following POST. 204 No Content reports success without a response body.

Follow a redirect without confusing it with a failure

301 Moved Permanently and 308 Permanent Redirect give a permanent new location. 302 Found and 307 Temporary Redirect give a temporary one. The response's Location header identifies the next address.

For example, a request to http://example.com/ can return 301 with Location: https://example.com/. The browser then sends a new request to the HTTPS address, which returns 200. Those are two exchanges, not a single response with two codes.

307 and 308 preserve the method when the browser repeats the request. After 301 or 302, a browser may change POST to GET. 304 Not Modified is a different kind of 3xx result: it validates a cached copy and sends no replacement body.

Match the code to the useful next check
CodeMeaning and next step
400 Bad RequestCheck malformed request data or syntax.
401 UnauthorizedSupply valid authentication, such as logging in.
403 ForbiddenThe server refuses access; check permission.
404 Not FoundCheck the exact requested path and filename.
405 Method Not AllowedCheck whether the endpoint accepts that method.
429 Too Many RequestsSlow down or wait before retrying.
500 Internal Server ErrorA general failure occurred inside the server.
502 Bad GatewayAn intermediary received an invalid upstream response.
503 Service UnavailableThe service is unavailable, often temporarily.
504 Gateway TimeoutAn intermediary did not receive an upstream response in time.

A 503 may include Retry-After to indicate when to retry. The difference between 401 and 403 is especially useful: missing or invalid authentication differs from a refusal of permission. A 4xx label identifies the request side to investigate, but a site can still have a broken link or a configuration problem that causes it.

Diagnose the particular resource

Suppose HTML and CSS return 200, while images/Logo.PNG returns 404. The server's actual file is images/logo.png. Correcting the link's case makes it identify the stored file. A server answered the failed request; the entire site was not unreachable.

For a 5xx response, the failure is in server-side handling. A learner viewing someone else's site can retry later or report it. A developer responsible for that server investigates its code or upstream service.

Read the response, not just the screen

An error message inside HTML does not determine the status. A site can return 200 with a "not found" message, called a soft 404. Conversely, a real 404 can include a polished HTML error page. Use the Network panel to read the actual code.

When DNS or the connection fails, no HTTP response may exist at all. A browser-generated error then has no server status to inspect. An isolated 404 for /favicon.ico, the small tab icon browsers may request, often leaves the page content working.

Key Takeaways

  • The first digit classifies a response; the full code gives a more specific outcome.
  • Redirects name their next location in Location; 307 and 308 preserve the method.
  • 304 means reuse a cached body, not download a new page at another address.
  • Check paths, authentication, permissions, and methods for relevant 4xx responses.
  • 5xx responses identify a failure in server-side handling.
  • An error page can have a body and status that tell different stories.
  • No HTTP response means there is no HTTP status code.
4

How HTML, CSS, and JavaScript become a page

The files a browser receives have different jobs. HTML gives content meaning, CSS controls its appearance, and JavaScript adds behavior. Follow how the browser combines them into a live page, and why a page can look correct while a button fails. Short code examples show what to recognize in each language and how script timing connects a loaded file to the elements it needs.

4.1 Structure, style, and behavior in separate files

A page combines content, presentation, and behavior. Recognizing these jobs helps you choose which file to inspect when you want to change something.

HTML describes what the content is

HTML, HyperText Markup Language, gives content structure and meaning: headings, paragraphs, lists, links, images, tables, and forms. It is a markup language. It describes elements instead of performing calculations or running loops.

In <a href="about.html">About us</a>, the opening tag is <a href="about.html">. The href attribute gives the destination. "About us" is the content, and </a> closes the element. Attributes belong inside the opening tag.

Some elements are void and have no content or closing tag. For example, <img src="logo.png" alt="Company logo"> supplies an image address and a text alternative. <br>, <link>, and <meta> are other void elements.

Choose elements for meaning. Use a heading because the text introduces a section; use CSS when you want larger text or extra spacing. Several <br> elements are a poor substitute for spacing rules.

CSS controls how content looks

CSS, Cascading Style Sheets, sets color, type, spacing, layout, and adaptation to different screen widths. Read this rule:

h1 {
  color: navy;
  font-size: 2rem;
}

The selector, h1, identifies the elements to style. Each declaration pairs a property with a value. color: navy; sets the color property to navy. The colon separates property and value; the semicolon ends the declaration.

JavaScript responds to actions

JavaScript is a programming language. It responds to clicks and typing, changes the live page, checks form input, and requests more data without a full page reload. It is a different language from Java.

For a theme button, a script can find the button, listen for clicks, and switch a CSS class:

document.querySelector("button").addEventListener("click", () => {
  document.body.classList.toggle("dark");
});

The script changes whether the body has the class dark; CSS supplies that class's appearance. A static information page can work with HTML and CSS alone.

Connect the files in HTML
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>My first page</title>
    <link rel="stylesheet" href="styles/main.css">
    <script src="scripts/app.js" defer></script>
  </head>
  <body>
    <h1>Hello, web</h1>
    <p>This text is structured by HTML and styled by CSS.</p>
    <button>Switch theme</button>
  </body>
</html>

The <head> holds page information and file links. The <body> contains the displayed content. The browser requests styles/main.css and scripts/app.js separately from the HTML. All three are plain-text files you can open in a code editor.

Separation of concerns keeps content in HTML, appearance in CSS, and behavior in JavaScript. One stylesheet can style many pages. A meaningful heading and an ordinary link still work if styling or scripting fails, while features that depend on JavaScript need their script to work.

Key Takeaways

  • HTML gives content structure and meaning; attributes add information to opening tags.
  • CSS selectors choose elements, and declarations set property values.
  • JavaScript adds behavior and can change the live page.
  • HTML links external CSS and JavaScript files, each loaded as a separate resource.
  • Separate content, presentation, and behavior to make changes easier to manage.

4.2 The live page inside the browser

The browser does not display HTML as a picture of a text file. It turns the file into objects, works out their styles and positions, and draws the result. JavaScript can then change those objects.

Build a tree from HTML

The DOM, or Document Object Model, is the browser's live tree of elements and text. Consider:

<body><h1>News</h1><p>Hi <a href="/">home</a></p></body>

The body has two element children, h1 and p. The heading contains "News". The paragraph contains the text "Hi " and an a element, which contains "home". The link is inside the paragraph, not directly inside the body.

While reading HTML, the browser discovers resources in elements such as <link>, <script>, and <img>. It requests those resources and reads the CSS to calculate each element's final styles. Layout calculates sizes and positions. Paint draws the pixels. These tasks can happen again when content or styles change.

Let scripts run when their elements exist

A classic external script without defer or async pauses HTML parsing while it downloads and runs. If it is in the head and tries to find a button later in the body, that button has not been built yet. document.querySelector("button") returns null, so calling addEventListener on the result produces an error.

Script loadingWhen a classic external script runs
Plain <script src="app.js">At its place in the document, pausing HTML parsing
With deferAfter HTML parsing, preserving document order
With asyncAs soon as it is ready, without guaranteed order

Add defer to let a script download while HTML parsing continues and run once that parsing is complete. Moving a plain script just before </body> also lets earlier elements exist first. async does not guarantee that a later button exists; its download may finish early.

Source HTML and the live DOM can differ

View Page Source shows the delivered HTML. The Elements panel, called Inspector in Firefox, shows the live DOM. JavaScript may have added content, changed text, or removed elements. The browser may also have repaired malformed HTML, for example by closing an element.

If a heading changes after a click, the Elements panel shows the changed text. View source still shows the HTML originally received. A DOM change can trigger updated styles, layout, and paint without fetching a new HTML document.

Different errors have different effects

Browsers repair HTML using defined rules and skip CSS declarations they do not understand. A JavaScript syntax error, such as an unfinished expression, prevents that script file or block from starting. An uncaught runtime error ends the current execution, skipping later lines in that run. Other scripts and already registered event handlers can still work. This explains a page whose content and style remain visible while one feature fails.

Browser engines implement common standards: Blink in Chrome and Edge, Gecko in Firefox, and WebKit in Safari. Small implementation differences make testing in more than one browser useful. Browsers also build an accessibility tree from the page's structure so screen readers can present meaningful elements and relationships.

Key Takeaways

  • The DOM is the live tree of elements and text built from HTML.
  • The browser calculates styles, performs layout, and paints pixels.
  • For classic external scripts, defer waits for HTML parsing; async does not guarantee that order.
  • View source shows delivered HTML; Elements shows the current DOM.
  • A syntax error stops a script from starting; an uncaught runtime error ends the current run.
  • Meaningful HTML also supports the accessibility tree.
5

Set up a project and inspect what happens

A small project folder and your browser's developer tools give you a practical way to learn. Save a page, preview it through a local server, and use the browser to inspect its live elements and requests. The panels answer different questions: what is on the page, which style wins, what code failed, and which resource arrived. Work through a complete edit-and-check loop so each change leaves evidence you can verify.

5.1 An editor, a project folder, and a preview

A web project starts as files in a folder. A code editor helps you write those files, and a browser lets you preview what they produce. Keeping the editor and browser pointed at the same copy of the project prevents many confusing results.

Choose a plain-text code editor

A code editor saves plain-text files and adds syntax highlighting, completion, error hints, a file tree, and other coding aids. Word processors store document formatting and may replace straight quotes with curly quotes, so they are unsuitable for source code.

Visual Studio Code is a free option for Windows, macOS, and Linux. Other editors include Sublime Text, Zed, and WebStorm. An online playground such as CodePen suits short experiments; the file and path skills carry over between tools.

Create and open a project

For a first VS Code project:

  1. Download and install the editor from its official website, https://code.visualstudio.com/.
  2. Create a folder such as web-projects/my-first-site.
  3. Choose File → Open Folder and open my-first-site so the file tree shows the whole project.
  4. Create index.html. In HTML mode, type ! and choose the Emmet suggestion for an HTML skeleton.
  5. Save with Ctrl+S on Windows/Linux or Cmd+S on macOS.

Use a folder structure that matches the roles of your files:

my-first-site/
  index.html
  styles/main.css
  scripts/app.js
  images/logo.png

Use lowercase names and hyphens, with no spaces. Keep the extensions visible so index.html does not silently become index.html.txt. Save text as UTF-8 and include <meta charset="utf-8"> in the HTML head so text such as accented names is interpreted correctly.

Choose a preview method
PreviewAddress starts withSuitable use
Open the file directlyfile:///Simple HTML and CSS checks
Run a local web serverhttp://localhost:.../Testing web paths and features served through HTTP

A local web server serves a folder on your own computer. It might use http://localhost:5500/ or http://127.0.0.1:3000/; use the address your preview tool supplies. Root-relative paths need a server to start at your site's root. Features such as JavaScript modules or fetching data also need HTTP preview because browsers restrict their use on local-file pages.

In VS Code, Microsoft's Live Preview extension or a Live Server extension can start a server and refresh the preview after saving. Check the publisher before installing extensions because extensions run code on your computer. Format on save, word wrap, and Auto Save can make editing easier; a formatter such as Prettier keeps formatting consistent.

Follow the edit-and-check loop

Edit, save, reload or let the preview reload, inspect the result, and fix the file. If the browser still shows old content, check the editor's unsaved indicator and compare the preview's path with the project you opened. You may have two folders with the same page name. Also check the exact filename and extension; a text-file suffix can stop the browser from treating a file as an HTML page.

Key Takeaways

  • Use a code editor that saves plain-text files, and open the complete project folder.
  • Keep clear folders, exact extensions, lowercase filenames, and UTF-8 text.
  • A local HTTP server supports site-root paths and features restricted on file: pages.
  • The working loop is edit, save, reload, inspect, and fix.

5.2 Inspect elements, styles, and errors

Browser developer tools expose the page you are actually running. Use them to test a style, read an error, or compare the live page with the file in your editor.

Open the tools and choose a panel

Right-click part of a desktop page and choose Inspect. Common shortcuts are F12 or Ctrl+Shift+I on Windows/Linux and Cmd+Option+I on macOS. Safari first needs its developer features enabled in Settings → Advanced; the option's wording varies with the Safari version.

PanelWhat it shows
Elements, or Inspector in FirefoxLive DOM and selected element's styles
ConsoleJavaScript messages, errors, and an input prompt
Sources, or Debugger in FirefoxLoaded source files and script debugging
NetworkRequests and their responses
Find a style that wins

Inspect a heading. Selecting its node highlights its box on the page, including content, padding, border, and margin. The Styles pane lists rules and their source locations, such as main.css:12. A crossed-out declaration is not taking effect there: another rule may override it, or the declaration may be invalid. Invalid declarations can also carry a warning indicator.

Open Computed to see the final values. If two rules specify different text colors, the computed color tells you the result. You can temporarily change a value, disable a declaration, or edit text and attributes to test an idea.

Ordinary live edits affect your tab's DOM or styles. Reloading replaces them with the loaded files. To keep an improvement, make the same edit in the source file, save, and reload. Changing a displayed price in Elements changes the local display; it does not change the server's stored price.

Read a console error as a clue

An error includes a message and usually a file and line. For example:

Uncaught TypeError: Cannot read properties of null
(reading 'addEventListener') at app.js:3

Read app.js:3 as the source location to inspect. The code tried to use a missing object. If a selector searched for a button, check that its spelling matches an element and that the element existed when the script ran. The message alone does not choose between those causes.

The Console also shows failed resource loads, such as a GET ending in 404, and messages printed by console.log(). A script error can explain a nonworking button even when its file downloaded successfully.

Try a small expression and a narrow screen

The Console can evaluate JavaScript. Typing 2 + 3 returns 5; document.title returns the current title. The assignment document.body.style.background = "lightyellow" changes the page's background in the tab. Do not paste code from someone you do not trust into the Console; it runs with access to the page and can misuse an account.

Use the phone-and-tablet icon for responsive mode. Choose a narrow width such as 375 CSS pixels to see how the layout fits. This simulates a viewport, not every behavior of a real phone; a real-device check adds information that resizing cannot provide.

Key Takeaways

  • Elements shows the live DOM; Styles and Computed help explain the final appearance.
  • Ordinary live edits must be copied into source files to survive a reload.
  • Use console messages and source locations to investigate failed code.
  • A missing-element error can come from a wrong selector or early script execution.
  • Responsive mode checks viewport sizes, while real devices can behave differently.

5.3 Trace a load in the Network panel

The Network panel shows the separate exchanges behind a page. It can reveal why one image is missing, why styling failed, or why a reload transferred less data than expected.

Record before reloading

Open DevTools, choose Network, make sure recording is active, and reload the page. The panel cannot reconstruct requests that finished before it was opened. If the list is empty, check recording and filters, then reload again.

Rows show each request's name or URL, method, status, type, size, and time. The waterfall shows when requests started and how their timings overlap. It helps you see a page load as several resource fetches instead of one indivisible action.

Open a row for the full evidence

Select a request. Headers shows the requested URL and method, response status, and request and response headers. Preview displays a useful view of supported response content. Response shows the returned content more directly, while Timing breaks down the time spent in phases of the request.

For a missing image, compare the full requested address with the image's actual location. A filename alone can hide a wrong parent folder.

Diagnose an example load
NameMethodStatusContent-TypeTransferred
index.htmlGET200text/html8.2 kB
main.cssGET200text/css3.1 kB
app.jsGET200text/javascript1.4 kB
Hero.jpgGET404text/html0.6 kB
logo.pngGET200image/png18.5 kB

Five requests transferred 31.8 kB in total. The Hero.jpg request failed. Its small HTML body is the server's error page, which explains the text/html media type on an image request. If the actual file is images/hero.jpg, change src="images/Hero.jpg" to src="images/hero.jpg" and reload to test the fix.

Filter on Img to focus on pictures, CSS for stylesheets, or a name to find a particular resource. When a stylesheet fails, inspect both its status and Content-Type. Even a 200 cannot make an HTML response into usable CSS.

Keep redirects and cached responses visible

Turn on Preserve log, called Persist Logs in Firefox, before following navigation that you want to trace. An HTTP-to-HTTPS redirect can then show a 301 row and its Location header followed by a new 200 request.

A row marked "(memory cache)" or "(disk cache)" means the browser reused stored content. A 304 still involved a server response, but only headers came back, saving a repeated body transfer. The Size and Transferred columns therefore answer different questions from the file's size alone.

Use Disable cache while DevTools is open to compare with fresh fetches. Throttling simulates a slower connection so you can watch which content appears first. Labels for speed presets vary by browser release.

A failed row without a response status can be a DNS or connection failure; Chrome may show net::ERR_NAME_NOT_RESOLVED. Outside the browser, curl -I https://example.com sends HEAD and prints the status and headers for a quick response check.

Key Takeaways

  • Open Network and start recording before reloading the page.
  • Inspect the full URL, status, media type, and response together.
  • Use filters for missing resources and Preserve log for navigation or redirects.
  • Cached bodies and 304 responses reduce transferred data in different ways.
  • Throttling shows behavior on a slower connection.
  • No response status can indicate a failure before HTTP received an answer.

How the Web Works examples

5 Walkthroughs

1

Follow a page from request to screen

12 steps
Trace a small page load and distinguish a missing resource from a failed connection.
  1. 1
    IntroductionWatch a page being assembled

    A page can show its heading while a picture is still loading. To explain that, follow a browser opening https://example.net/trails.html. We will separate the browser’s request, the server’s reply, and the extra resources named in the HTML. Then use the same sequence to locate a failure.

  2. 2
    ExplanationIdentify who asks and who answers

    The browser is the client: it initiates the request for a resource. The server runs software that answers with a stored file or generated content. These are roles. A laptop can run both your browser and a local test server.

    For this visit, the browser asks for /trails.html, and the server returns a response whose body contains HTML.

  3. 3
    AnalogyTreat a request like an order

    Think of the client as a customer placing an order at a counter. The request identifies what the customer wants, and the response is what comes back.

    For an ordinary HTTP resource fetch, the browser starts the exchange. The server does not need to know what the page looks like on your screen; it supplies the requested content for the browser to interpret.

  4. 4
    ExampleCount the document before its pictures

    Suppose the returned HTML names one stylesheet, one script, and two images. Start by counting the HTML itself: that is one resource. Add the stylesheet and script to reach three, then the two images to reach five.

    With an empty resource cache, fetching these files takes five resource requests. The page looks like one object on screen, but its parts travel separately.

  5. 5
    ChallengePredict a partly working page

    The HTML, script, and stylesheet arrive, but one of the two image requests fails. Must the whole page disappear? Explain.

    ---reveal---

    No. The browser can display the resources it received while the failed image remains missing. Each resource has a separate exchange. Success for the HTML does not guarantee success for the picture, and failure for the picture does not erase the HTML.

  6. 6
    ExplanationFind the host before requesting the path

    For https://example.net/trails.html, the browser identifies the host example.net and path /trails.html. DNS supplies an IP address for that host unless a recent answer is already cached.

    The browser then connects to that destination. A name lookup provides the address; it does not download the HTML or any of its linked images.

  7. 7
    Key InsightProtect the connection

    Because the scheme is https, the browser establishes TLS protection before the ordinary HTTP exchange. The server’s certificate supports checking its identity for the domain.

    This protects messages against reading or alteration on the network. A valid certificate and a secure connection do not establish that a site’s business or claims are honest.

  8. 8
    ExampleBuild as the files arrive

    The browser sends its request and receives the HTML response. Reading the HTML reveals the CSS, script, and image addresses. The browser requests those resources and can overlap their downloads.

    It builds the document, applies styles, runs scripts, and draws the page. Text can appear first, with the images filling in later. It does not wait for every file before beginning all display work.

  9. 9
    ChallengeDistinguish no address from no file

    One visit fails with a name-resolution error and no response status. Another returns 404 for /trails.html. Did both failures reach the same stage?

    ---reveal---

    No. The first failed to obtain the host’s address, before an HTTP response arrived. The second reached a server that answered but did not find the resource. A browser error page can appear in both cases, so inspect the network evidence.

  10. 10
    ConnectionReuse earlier work on another visit

    On a later visit, the browser may already know the host’s address and hold fresh copies of some files. DNS caching avoids another name lookup; resource caching avoids some repeated downloads.

    If a stored resource needs validation, the server can answer 304 Not Modified. That exchange still occurs, but it carries no new resource body because the saved one is usable.

  11. 11
    ChallengeLocate the failure in the full sequence

    A page’s HTML returns 200, but its CSS request returns 404. The page shows plain text. Which step failed, and what should you check?

    ---reveal---

    The initial page request succeeded; a later resource request failed. Check the stylesheet’s resolved URL against its actual location and filename. Repeating DNS setup is not the useful first check because the server already answered the CSS request.

  12. 12
    RecapUse the sequence to choose a check

    Read the load as a sequence: identify the host, find its address, connect, request, receive, and build. Remember that the HTML usually triggers more requests.

    When something fails, first locate the failed stage. Then check the specific host, path, response, or browser action involved.

2

Read a URL and trace its links

14 steps
Separate address parts, check domain control, and resolve paths through a small site.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionGive each address part a job
  2. 2
    ExampleSplit the destination from the resource
  3. 3
    ExplanationSeparate input from a page location
  4. 4
    ChallengeChange only the fragment
  5. 5
    ExplanationRead a host from the right
  6. 6
    ExampleInspect a look-alike host
  7. 7
    ChallengeExplain what registration supplies
  8. 8
    ExplanationChoose the link’s starting point
  9. 9
    ExampleClimb out of a nested folder
  10. 10
    ExampleTry another valid starting point
  11. 11
    ChallengeFind a neighboring page
  12. 12
    TipKeep the path spelling exact
  13. 13
    ChallengeCombine the host and path checks
  14. 14
    RecapRead before you follow
3

Read an exchange and choose the next check

16 steps
Work through requests, cached responses, redirects, and status evidence.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionUse the messages as evidence
  2. 2
    ExampleRead the first line and host
  3. 3
    ExplanationMatch a method to the action
  4. 4
    ExampleRead a small submitted body
  5. 5
    ChallengePredict a repeated submission
  6. 6
    ExplanationSeparate status, headers, and body
  7. 7
    ExampleConnect separate requests with a cookie
  8. 8
    ExampleUse a fresh copy first
  9. 9
    ExampleValidate after freshness expires
  10. 10
    ChallengeExplain a small transfer
  11. 11
    ExplanationUse the class to narrow the problem
  12. 12
    ExampleDistinguish identity, permission, and path
  13. 13
    ExampleFollow a new location
  14. 14
    ChallengeRead the error family precisely
  15. 15
    ChallengeRead the reply behind the name
  16. 16
    RecapCombine the message parts
4

Turn source files into a live page

12 steps
Follow the jobs of HTML, CSS, and JavaScript, then fix a script that runs too early.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionFollow a button from markup to behavior
  2. 2
    ExampleGive the content a meaning
  3. 3
    ExampleAdd a presentation rule
  4. 4
    ExplanationReact to the click
  5. 5
    ChallengeChoose the file for the change
  6. 6
    ExplanationBuild the live tree
  7. 7
    ExampleRun too early and find nothing
  8. 8
    ExampleWait for the parsed document
  9. 9
    Key InsightCompare source with the live result
  10. 10
    ChallengeExplain a visible page with a failed button
  11. 11
    ChallengeCombine arrival, timing, and the live DOM
  12. 12
    RecapConnect each stage to its result
5

Set up, preview, inspect, and fix a page

15 steps
Use an organized project and three browser panels to verify a lasting source fix.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionMake one change you can verify
  2. 2
    ExplanationOpen a project in a code editor
  3. 3
    ExamplePreview through HTTP
  4. 4
    ChallengeFind why an edit seems missing
  5. 5
    ExampleInspect the element you want to change
  6. 6
    ExampleTest a style, then save it
  7. 7
    ChallengeChoose evidence for a silent button
  8. 8
    TipCheck a narrow viewport
  9. 9
    ExplanationRecord the next load from its start
  10. 10
    ExampleRead a failed picture’s full URL
  11. 11
    ExampleVerify the result of the source fix
  12. 12
    Key InsightSeparate reuse from a new body transfer
  13. 13
    ChallengeInterpret a redirect and its destination
  14. 14
    ChallengeCombine the editor and browser checks
  15. 15
    RecapClose the loop in the saved source

How the Web Works practice questions

40 Practice Questions in 4 sets

Set 1: Follow addresses and resource requests10 Practice Questions

Question 1 of 10

A browser asks for a trail map, and a program returns the image. Which role does the program returning the image perform?
  1. The client role, because it handles an image.
  2. The cache role, because it handles a request.
  3. The server role, because it answers the request.
  4. The browser role, because it supplies a resource.
Show answerHide answer
Answer: C
The program acts as a server because it answers the client’s resource request. The browser is the client that initiated the exchange; handling an image does not determine the role. Client and server describe what each participant does in this conversation, even when both programs run on one computer.

Question 2 of 10

A new page has one HTML file, one stylesheet, two scripts, and three images, all on one host. DNS and browser resource caches start empty. How many resource requests are needed to fetch these files?
  1. Seven resource requests.
  2. Six resource requests.
  3. Eight resource requests.
  4. One resource request.
Show answerHide answer
Answer: A
Count every resource, including the initial HTML: one page, one stylesheet, two scripts, and three images make seven requests. The DNS lookup finds the host’s address but is not an additional HTTP resource request. Counting only the linked files would miss the document that first names them.

Question 3 of 10

In https://learn.example.org:9443/notes.html?unit=4#tasks, what is the request path?
  1. learn.example.org:9443
  2. /notes.html?unit=4#tasks
  3. unit=4
  4. /notes.html
Show answerHide answer
Answer: D
The path is /notes.html, the part identifying the resource after the host and optional port. The query begins at ?, and the fragment begins at #, so neither belongs to the path. The HTTP request target can include the query, which is a larger part than the path alone.

Question 4 of 10

A message links to https://billing.example.com.check.example.net/pay. Which registered domain controls this host?
  1. example.com
  2. example.net
  3. check.example.net
  4. billing.example.com
Show answerHide answer
Answer: B
Read the host from the right: .net is the public ending, and example.net is the registered domain. The labels check, com, example, and billing sit beneath it. The familiar example.com at the left does not make this a host controlled through that registered domain.

Question 5 of 10

A site is moved from the root of https://example.org/ into https://example.org/course/, keeping its folder structure. On course/lessons/start.html, ../images/map.png works but /images/map.png fails; the map is at course/images/map.png. What explains the difference?
  1. The root-relative link keeps the old host; the other link changes hosts.
  2. Both links stay inside lessons; the working copy must come from cache.
  3. The relative link climbs into course; the leading slash starts at the host root.
  4. The relative link starts at the host root; the leading slash stays in course.
Show answerHide answer
Answer: C
The current page’s folder is /course/lessons/, so ../ climbs to /course/ before entering images/. A leading slash discards the current path and requests /images/map.png at the host root. Moving the folder tree kept the relative relationship but changed its location below the site root.

Question 6 of 10

A form creates a new event registration. Which HTTP method is intended to submit its data for processing?
  1. HEAD
  2. POST
  3. GET
  4. OPTIONS
Show answerHide answer
Answer: B
POST is intended to submit data for the server to process, which fits creating a registration. GET is intended to retrieve resources and should not request that state change. Putting form data in a URL does not turn a read method into the appropriate method for creating a new record.

Question 7 of 10

A site’s HTML returns 200. Its diagram request returns 404. What does that evidence establish?
  1. The server could not be reached for either request.
  2. The browser received neither the page nor the diagram.
  3. The diagram failed because the user needs authentication.
  4. The server answered but did not find the requested diagram.
Show answerHide answer
Answer: D
A 404 is an HTTP response saying the requested resource was not found. The successful HTML exchange and the failed diagram exchange are separate, so the page can still display without that diagram. A server that could not be reached would not have supplied the 404 response.

Question 8 of 10

A heading has correct wording but needs more space above it. Which kind of source change fits that need?
  1. Change a spacing declaration in CSS.
  2. Change the heading’s text in HTML.
  3. Change the click handler in JavaScript.
  4. Add line breaks above the heading.
Show answerHide answer
Answer: A
CSS controls presentation, including spacing around a heading. The existing heading can keep its semantic role and wording while a style declaration changes its position. Adding line breaks in the HTML to imitate spacing would mix a visual adjustment into the document’s content structure.

Question 9 of 10

A preview opened by double-clicking index.html has an image at /images/compass.png that fails. The project contains that file under its images folder. What preview change lets the leading slash refer to the site root?
  1. Open the same page with a text editor.
  2. Rename the image with capital letters.
  3. Serve the project through a local HTTP server.
  4. Move the image into the browser’s cache.
Show answerHide answer
Answer: C
A local server gives the project an HTTP site root, so /images/compass.png is resolved from that root. A direct file: preview interprets a leading slash from the file system’s root instead of the project folder. The image’s existence inside the project does not change that starting point.

Question 10 of 10

You open Network after a page has finished loading, and the list contains none of its original requests. How can you record the initial load?
  1. Keep recording active and reload with Network open.
  2. Inspect the heading and switch off its CSS rules.
  3. Read View Page Source and keep the page unchanged.
  4. Close DevTools and reload before opening it again.
Show answerHide answer
Answer: A
Network needs to be open and recording when the requests occur. Reloading with recording active captures the document and the resources it triggers. Opening the panel afterward does not recreate the exchanges that have already finished; closing it before another reload repeats the same capture problem.
Set 2: Read messages and follow broken resources10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

A library server sends the same stored hours.html file on each request, but runs a program to build a catalog search reply. How are the two responses classified?
  1. Both are dynamic because browsers request them.
  2. Hours is dynamic; the search reply is static.
  3. Both are static because both can contain HTML.
  4. Hours is static; the search reply is dynamic.
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

A browser opens https://example.net/find?q=trees#results. What target does an ordinary HTTP/1.1 request use?
  1. /find?q=trees#results
  2. /find?q=trees
  3. example.net/find
  4. /find#results
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

A page is at https://example.com/help/setup/linux.html. The stylesheet is at https://example.com/assets/theme.css. What relative path reaches it?
  1. ../assets/theme.css
  2. assets/theme.css
  3. ../../assets/theme.css
  4. ../../help/assets/theme.css
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A response includes Content-Type: application/json. What does this header describe?
  1. The format of the response body.
  2. The method that started the request.
  3. The name of the destination server.
  4. The time when the cached file expires.
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

A protected report responds 401 before sign-in. After valid sign-in, it responds 403. What changed?
  1. The report was created, then permanently redirected.
  2. The report first needed identity, then still refused access.
  3. The server first failed, then the report was not found.
  4. The report first needed permission, then needed identity.
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A browser POSTs to /join; a 302 redirects to /register. The browser next sends GET there and receives 405. /register accepts POST with the original body, and the move is temporary. What redirect change preserves the intended submission?
  1. Use 301 to keep a permanent POST redirect.
  2. Use 304 to reuse the registration response.
  3. Use 308 to describe the move as temporary.
  4. Use 307 to preserve the POST method and body.
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A script changes a page’s heading after loading. Where can you inspect the updated element text?
  1. The original response’s status line.
  2. The cached DNS record for the host.
  3. The live DOM in the Elements panel.
  4. The original HTML in View Page Source.
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A page intended to be HTML was saved as home.html.txt. What filename correction makes it an HTML source file?
  1. home.html
  2. home.txt
  3. home.html.txt
  4. home-html.txt
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

You test a paragraph color in Elements and like the result. After reloading, the old color returns. How can you keep the tested color?
  1. Change the displayed text and close the tab.
  2. Repeat the edit in Elements after each reload.
  3. Save the original HTML without editing CSS.
  4. Edit the source CSS, save it, and reload.
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

At https://example.org/journal/entry.html, a link requests styles/site.css. Network shows 200, Content-Type: text/html, and an HTML fallback page. The real CSS is at /styles/site.css. What source correction and check address the failure?
  1. Keep the path and check whether the status stays 200.
  2. Use /styles/site.css and verify a CSS body and media type.
  3. Use journal/styles/site.css and verify the fallback HTML.
  4. Keep the path and give the returned HTML a .css name.
Show answerHide answer

Save this lesson to see this answer.

Set 3: Connect page behavior with network evidence10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

A browser has a fresh cached DNS answer for a host but no cached page resources. What can it reuse when opening a page there?
  1. The HTML body, without making its resource request.
  2. The certificate, as proof that the site owner is honest.
  3. The host’s address, without a new DNS lookup.
  4. The response status, without contacting the server.
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

Two links claim to open the same help center: https://help.example.com/topic and https://example.com.help.example.org/topic. Both have valid HTTPS certificates. What comparison identifies their controlling domains and the meaning of the certificates?
  1. Both belong to example.com; certificates confirm a shared owner.
  2. Both belong to example.org; the left labels select the help pages.
  3. The hosts have different owners only if one certificate is invalid.
  4. Their registered domains differ; valid certificates do not establish a shared owner.
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

A page at https://example.net/reference/start.html uses ../about.html. What address does the browser resolve?
  1. https://example.net/about.html
  2. https://example.net/reference/about.html
  3. https://example.net/reference/start.html/about.html
  4. https://example.net/reference/../reference/about.html
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A sign-in form uses POST over plain HTTP. A developer says its password is encrypted because it is absent from the address bar. What change supplies protection in transit?
  1. Keep HTTP and rename the POST fields.
  2. Use HTTPS for the form submission.
  3. Use GET so the password becomes query input.
  4. Add a fragment containing the password.
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

On a repeat load, an image has a fresh cached response and a stale script is validated with 304. A changed stylesheet returns 200 with a 5 kB body. An uncached HTML page returns a 9 kB body. Excluding headers, how much body data crosses the network?
  1. 5 kB of resource bodies.
  2. 9 kB of resource bodies.
  3. 14 kB of resource bodies.
  4. 0 kB of resource bodies.
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A button should add a class when clicked, and that class should change the page’s colors. How should the two jobs be assigned?
  1. HTML handles the click; JavaScript defines color declarations.
  2. CSS handles the click; HTML switches the class value.
  3. HTML defines colors; CSS edits the live class value.
  4. JavaScript changes the class; CSS defines its appearance.
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

An external classic script in the head loads with 200 and throws an error when calling addEventListener on null. Its selector exactly matches a button later in the body, and the final DOM contains that button. What edit addresses the timing shown?
  1. Add defer so the script runs after HTML parsing.
  2. Add async so the script always runs after the button.
  3. Move the button’s CSS above the script request.
  4. Change the script URL fragment to the button ID.
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

You save a heading in projects/atlas/index.html, but the preview address points to projects/atlas-copy/index.html. Reloading still shows the old heading. What should you align first?
  1. The font size and the viewport width.
  2. The network speed and the server’s certificate.
  3. The previewed project and the edited project.
  4. The image extension and the stylesheet selector.
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

Which DevTools view shows the final color value applied to a selected heading?
  1. The Network method column.
  2. The Computed styles tab.
  3. The View Page Source tab.
  4. The Console’s history.
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

A URL redirects during navigation, and you want to keep both the original response row and the destination request visible. Which Network setting should be enabled first?
  1. Disable all CSS declarations.
  2. Switch to responsive device mode.
  3. Open only the image type filter.
  4. Enable Preserve log across navigation.
Show answerHide answer

Save this lesson to see this answer.

Set 4: Diagnose a complete local page10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

A page’s HTML comes from www.example.org, but its photos are addressed at photos.example.net. Where does the browser request the photos?
  1. From www.example.org, because that host sent the HTML.
  2. From photos.example.net, using each photo’s address.
  3. From the current page folder on www.example.org.
  4. From whichever host supplied the stylesheet.
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

HTML and CSS from www.example.com return 200. A logo URL uses cdn.example.net, and its row shows net::ERR_NAME_NOT_RESOLVED with no status. What part of the load failed, and why can the text still appear?
  1. The logo path was missing; its host returned 404 while the page loaded.
  2. The logo host connected but refused the image; the page loaded separately.
  3. The page host’s lookup failed; cached resources supplied its 200 responses.
  4. The logo host’s name lookup failed; the page resources succeeded.
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

Which URL part begins after # and is handled locally by the browser?
  1. The query string.
  2. The port number.
  3. The fragment.
  4. The host name.
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A developer registers a domain but has not made any page files available from a server. What additional job is needed for a website?
  1. Host resources on a server and configure the name to reach it.
  2. Add DNS records but keep page files in an unserved local folder.
  3. Add www and renew the name without running server software.
  4. Use localhost as the public name and leave the files unserved.
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

A form POSTs to /comments. A 307 redirects to /store, which accepts only POST, creates one comment per submission, and returns 201. The user repeats the original submission once; the browser follows the redirect again. What methods reach /store, and how many comments are created?
  1. Two GET requests; no comments are created.
  2. One POST, then GET; one comment is created.
  3. Two POST requests; two comments are created.
  4. Two POST requests; one comment is created.
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A login response includes Set-Cookie: session=xyz. The browser stores it, and the next request matches the cookie’s scope. Which request header lets the server connect that request to the stored session?
  1. Set-Cookie: session=xyz
  2. Location: session=xyz
  3. Content-Type: session=xyz
  4. Cookie: session=xyz
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A page displays “That article was not found,” but its document row has status 200. How should this result be described?
  1. A soft 404: not-found content with a success status.
  2. A DNS failure: the server sent no response at all.
  3. A 403: the wording shows the reader lacks permission.
  4. A redirect: the browser must have changed addresses.
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A page uses <h1> just to enlarge an ordinary note. What change gives the note an appropriate role while keeping control of its size?
  1. Keep the heading and put several line breaks before it.
  2. Use a paragraph for the note and set its size in CSS.
  3. Keep the heading and style it to resemble a paragraph.
  4. Use a smaller heading level for the note.
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

Two classic external scripts are in the head: helpers.js defines a function, and page.js uses it and a button later in the body. Both are currently async, and failures vary with download speed. Which loading change makes both dependencies available in order?
  1. Keep async on both and place page.js first.
  2. Remove both attributes and put page.js first.
  3. Add defer to both while keeping async on helpers.js.
  4. Use defer on both, remove async, and list helpers.js first.
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

Styles shows color: green crossed out and an active color: maroon; Computed reports maroon. You change the active value to teal in DevTools, but it returns to maroon on reload. What do both observations show, and how do you keep teal?
  1. Green is invalid; remove every matching rule from the page.
  2. Teal was saved; clear CSS filters to reveal the source change.
  3. Maroon won; save the teal edit in the source rule that supplies it.
  4. Computed is stale; keep changing the crossed-out green declaration.
Show answerHide answer

Save this lesson to see this answer.

Stuck on your own question? Homework Help

Key Terms

73 Key Terms, each with its definition

A

Absolute URL
An absolute URL supplies its own scheme and host, so its destination can be identified independently of the current page’s address.
The link https://example.net/help.html reaches that host whether clicked from a home page or a nested post.
Attribute
An attribute supplies extra information in an HTML opening tag, such as href for a link destination or src for an image source.
In <a href="team.html">Team</a>, the href attribute tells the browser where the link goes.
Authentication
Authentication checks a requester’s identity, often through login credentials or a session, before protected content is supplied.
A 401 response can mean that the request needs valid authentication before the server will fulfill it.

B

Body
A body is the content carried after an HTTP message’s headers, such as submitted form fields or a returned image’s bytes.
A POST can carry account details in its request body, while a GET response can carry an HTML body.

C

Cache
A cache is storage for copies of previously retrieved data that can be reused, reducing repeated downloads or lookups.
A fresh cached logo can appear on your next visit without downloading the same image body again.
Certificate
A certificate supplies identity information that lets a browser verify that a server is authorized to serve the requested domain.
A valid certificate supports a secure connection check, but a dishonest site can hold one too.
Client
A client is a program or device that initiates a request to another program, such as a browser requesting a page from a web server.
When you follow a link, your browser acts as the client and asks for the resource at that address.
Code editor
A code editor is a program for writing plain-text source files, with aids such as syntax highlighting, completion, and a project file tree.
Opening the site folder in an editor lets you see the HTML page alongside its CSS and image folders.
Computed styles
Computed styles are the resulting CSS values the browser determines for an element after considering applicable rules and inheritance.
The Computed tab reveals the heading’s resulting color when several matching rules specify colors.
Console
The Console is a developer-tools panel that displays messages and errors and can evaluate JavaScript entered for the current page.
A console error naming app.js:8 directs you to the script line involved in the failed operation.
Content-Length
The Content-Length header expresses a byte count for message content; that count is not necessarily the number of readable characters.
For a PNG response, Content-Length: 24576 describes 24,576 bytes, or about 24.6 kB of content.
Cookie
A cookie is a small stored value that the browser can return on matching requests, helping a server connect them to session data.
A server sends a session value with Set-Cookie; the browser later sends it back in Cookie.
CSS
CSS, Cascading Style Sheets, describes the presentation of document elements, including their colors, spacing, fonts, and layout.
A shared CSS file can change heading colors across several pages without rewriting their text.

D

Declaration
A declaration is a CSS property-value pair, such as color: teal;, that specifies one presentation setting inside a rule.
In p { color: navy; margin: 1rem; }, two declarations set paragraph color and margin.
Deferred script
A deferred script is a classic external script marked defer that runs after HTML parsing, preserving document order among such scripts.
A deferred button script can select a button defined later in the HTML because parsing has finished.
Developer tools
Developer tools are browser features for inspecting a running page’s live structure, applied styles, scripts, errors, and network exchanges.
Choosing Inspect on a heading opens the tools with that part of the current page selected.
DNS
DNS, the Domain Name System, is the distributed naming system that lets browsers find network addresses associated with domain names.
Before connecting to a new host, the browser obtains its address from DNS or a recent cached answer.
DOM
The DOM, or Document Object Model, is the live tree of document elements and text that the browser builds and scripts can modify.
After a script adds a paragraph, Elements shows the new DOM node even though view source has no such paragraph.
Domain name
A domain name is a readable internet name made of labels separated by dots, used to refer to a network destination through DNS.
The name docs.example.com is easier to remember than the numeric address DNS may return for it.

F

Forbidden response
A forbidden response has status 403, meaning the server understood the request but refuses to provide the requested access.
An account may be signed in yet receive 403 when it has no permission to open a protected resource.
Fragment
A fragment is the URL part after # that the browser handles locally, often by moving to an element with a matching ID.
The fragment #contact can scroll the fetched document without sending contact to the server.
Fresh response
A fresh response is a cached response still within the period in which caching rules allow reuse without checking with the server.
A response with max-age=600 can remain fresh for 10 minutes before it needs another freshness decision.

G

Gateway timeout
A gateway timeout is a 504 response indicating that an intermediary server did not receive an upstream server’s response in time.
A proxy can return 504 while waiting for the application server that should have produced the page.

H

Header
A header is a named HTTP field carrying information about a request, response, or body, commonly displayed as Name: value.
The request header Accept: text/html says that the client can handle an HTML response.
Host
A host is the destination named in a web URL, commonly by a domain name or IP address, before the path begins.
In https://learn.example.net/intro, the host is learn.example.net and the path is /intro.
HTML
HTML, HyperText Markup Language, gives page content structure and meaning through elements such as headings, links, images, and forms.
A heading element identifies a section heading even when the page’s external stylesheet fails to load.
HTTP method
An HTTP method states the intended action of a request, such as GET to retrieve a resource or POST to submit data for processing.
A GET search retrieves results, while a POST can submit a comment for the server to store.
HTTPS
HTTPS is HTTP carried over a TLS-protected connection that encrypts the messages and authenticates the server for the domain.
An HTTPS connection protects a submitted form in transit even when the form is sent with POST.

I

Idempotent method
An idempotent method has the same intended server-side effect when an identical request is repeated as when it is sent once.
Repeating a DELETE does not request another distinct deletion, even if the second response code differs.
Internet
The internet is the worldwide network of connected computers that carries data for the web and other services, including email.
An email program and a web browser can both use the internet while providing different services.
IP address
An IP address is a numeric network address used to identify a destination, written in a format such as IPv4 or IPv6.
The example IPv4 address 203.0.113.10 can represent a server destination in a page-loading diagram.

J

JavaScript
JavaScript is a programming language used in browsers to respond to events, change the live page, and request additional data.
A click handler can add a class to the body so the stylesheet displays a different theme.

L

Label
A label is one part of a domain name between dots; ordinary host labels use letters, digits, and hyphens with length limits.
The host help.example.org has three labels, read from the general ending toward the specific name.
Layout
Layout is the browser’s calculation of element sizes and positions after it has determined the styles relevant to those elements.
Adding a long paragraph can require new layout calculations because content below it moves down.
Local web server
A local web server is server software running on your computer to serve project resources through HTTP for development and testing.
A preview at http://localhost:5500/ handles a site-root path as a web path instead of a disk-root path.
Loopback address
A loopback address sends network traffic back to the same computer, such as 127.0.0.1 in IPv4 or ::1 in IPv6.
Opening a server at 127.0.0.1 connects your browser to a service running on your own computer.

M

Media type
A media type, also called a MIME type, identifies a body’s format, such as text/css for CSS or application/json for data.
If a CSS request returns text/html, inspect whether the server supplied an error page instead.

N

Network filter
A Network filter narrows recorded request rows by criteria such as resource type or name, helping you focus on a suspected failure.
Select the CSS filter to find a missing stylesheet while the page’s other requests stay out of view.

P

Paint
Paint is the browser’s drawing of pixels for the page after the necessary styles and layout have been determined.
Changing a visible text color causes the browser to draw the affected text with the new color.
Parent directory
A parent directory is the folder containing another folder; ../ moves to one parent level while resolving a relative web path.
From /notes/week/page.html, ../index.html reaches /notes/index.html after one move upward.
Parsing
Parsing is the process of reading source text according to a language’s rules and turning it into a structure the browser can use.
As the browser parses HTML, it builds elements and discovers the external files the document names.
Path
A path is the URL part that identifies a resource on a host, sometimes matching folders and files and sometimes handled by software.
The path /images/map.png tells the server which resource the browser wants after connecting.
Port
A port is a number that selects a service at a host; HTTP normally defaults to 80 and HTTPS normally defaults to 443.
The 8080 in http://localhost:8080/ selects the port used by that particular local test server.
Preserve log
Preserve log is a Network option that retains recorded request rows across page navigation, helping reveal a sequence of exchanges.
Enable Preserve log before opening an address that redirects so the earlier response remains visible.
Project folder
A project folder holds the related source files and assets for a site, providing a clear base for organizing paths and previewing changes.
Keeping index.html, styles/, and images/ together makes it easier to check whether a link matches a file.

Q

Query string
A query string is the URL input after ?, commonly arranged as name=value pairs separated by & and sent with the request target.
In /search?q=css&page=3, the query supplies both the search term and the requested results page.

R

Redirect
A redirect is a response that directs a client to another address, normally given in the Location header with a redirect status.
A 301 from an HTTP address can send the browser to request the HTTPS address in a second exchange.
Registrar
A registrar is an organization that handles customers’ domain registrations and renewals for the domain endings it supports.
A site owner renews a registered name through a registrar to keep the right to use it for another term.
Registry
A registry is the organization maintaining the authoritative registration records for a top-level domain and its registered names.
The registry keeps the TLD’s domain records while a registrar handles the customer’s registration.
Relative URL
A relative URL omits some address parts and is resolved from the current page’s address, often beginning in its containing folder.
From /guide/start.html, the link images/icon.png reaches the images folder inside /guide/.
Request target
A request target identifies the resource requested in an HTTP message, commonly by its path and query, without the URL fragment.
The URL ending /guide?mode=short#tips produces the target /guide?mode=short in an ordinary request.
Resource
A resource is something identified by an address, such as an HTML page, image, stylesheet, script, font, or piece of data.
A page and its four pictures are five resources, even though the browser presents them together.
Responsive mode
Responsive mode is a developer-tools preview that adjusts viewport dimensions to help inspect layouts at different screen sizes.
A narrow responsive preview can reveal sideways overflow, though a real phone still needs its own check.
Root-relative path
A root-relative path begins with / and identifies a location from the current site’s root instead of the current page’s folder.
From any nested page on example.org, /images/logo.svg starts at that host’s top-level path.
Runtime error
A runtime error occurs while code is executing; if uncaught, it ends the current run and skips later instructions in that run.
Calling a method on null can stop a script from setting up its button even though the script downloaded successfully.

S

Safe method
A safe method is an HTTP method intended to read information without requesting a change to server state, such as GET or HEAD.
Opening a normal page link should retrieve content without placing an order or deleting stored data.
Scheme
A scheme is the opening part of a URL that identifies how it is handled, such as https for encrypted HTTP or file for a local file.
The scheme in http://localhost:8080/ tells the browser to use HTTP for the local preview request.
Selector
A selector is the part of a CSS rule that identifies which elements should receive the rule’s presentation declarations.
The selector h2 in h2 { color: teal; } matches second-level heading elements on the page.
Server
A server is a program, or the computer running it, that receives requests and returns stored resources or generated responses.
A test server on your laptop can answer the browser while both programs run on the same computer.
Soft 404
A soft 404 is a response whose content indicates that a resource was not found even though its HTTP status reports ordinary success.
A page displaying "Nothing here" with status 200 differs from a response whose actual status is 404.
Stateless protocol
A stateless protocol handles each exchange independently without automatically linking it to earlier exchanges by the same client.
A later HTTP request must send a cookie or similar identifier if the server is to recognize a session.
Status code
A status code is a three-digit HTTP response value describing the outcome of one request, with the first digit identifying its class.
A page can have 200 for its HTML and 404 for one picture because the resources have separate requests.
Subdomain
A subdomain is a name formed by adding labels to the left of a domain and managed under the authority of that domain.
The holder of example.com can arrange a service at support.example.com without registering a new domain.

T

Throttling
Throttling simulates a slower network connection in developer tools so you can inspect the order and timing of visible page loading.
A slow-network preview makes it easier to notice text appearing before a large image finishes.
TLS
TLS, Transport Layer Security, is the technology HTTPS uses to protect messages from being read or changed while they travel.
The browser sets up TLS protection before sending an ordinary HTTPS request to the destination.
Top-level domain
A top-level domain, or TLD, is the rightmost level in the domain name system, such as .com, .org, or the country-code .nl.
In news.example.org, the TLD is .org; news is a more specific label under the registered name.
Transferred size
The transferred size measures data sent over the network for a recorded request and can differ from a resource’s stored body size.
A 304 transfers headers without the image body, so its recorded transfer is much smaller than that image.

U

URL
A URL, or Uniform Resource Locator, is an address identifying a resource and describing how to access it, with optional query and fragment parts.
In https://example.org/help.html#hours, the whole address is the URL; example.org is just its host.
UTF-8
UTF-8 is a text encoding that represents characters as bytes and supports the many writing systems commonly used in web content.
Save a page as UTF-8 and declare that encoding so accented names are read consistently by the browser.

V

Viewport
A viewport is the area in which the browser lays out and displays a page, whose width affects how the content fits on screen.
Reducing the responsive viewport to 375 CSS pixels helps reveal a menu that no longer fits.
Void element
A void element is an HTML element that cannot contain child content and has no closing tag, such as img, meta, or link.
The element <img src="map.png" alt="Trail map"> describes an image without a matching closing tag.

W

Waterfall
A waterfall is the Network panel’s timing display, showing when requests start, how long they take, and where their durations overlap.
Overlapping image bars show that the browser fetched several pictures during the same period.
Web
The web is a service of linked resources identified by web addresses and exchanged through HTTP over the internet.
Following a page link uses the web; the internet also carries services that do not involve web pages.

About this lesson

By StudeliReport a mistake

Make your own Study Materials

Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.

Get Started