How a web page reaches you

Read a URL

Break a web address into its scheme, host, path, query, and fragment so links and resources make sense later in the course.

6 minute lesson

~~~

A URL identifies a resource on the Web.

Consider this one:

https://example.com/guides/html/?format=short#links

It has several parts:

  • https is the scheme
  • example.com is the host
  • /guides/html/ is the path
  • format=short is the query string
  • links is the fragment

The scheme tells the browser which protocol to use. For websites, that is normally HTTPS.

The host identifies the server. The path identifies a resource on that server. A query string passes extra information, while the fragment points to a location inside the document.

There is one important detail: the browser does not send the fragment in the HTTP request. It uses the fragment after the page arrives, usually to scroll to an element with a matching id.

You will use URLs in links, images, stylesheets, scripts, audio, video, and forms. Understanding their parts now will make all of those elements easier to use.

Try it

Take the URL in your address bar and identify its scheme, host, and path. If it has a ? or #, identify the query and fragment too.

Lesson completed