Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Before we can talk about hyperlinks, we first need to talk about URLs. URL stands for Uniform Resource Locator. It's a way of specifying the location of a resource on the Internet. A resource can be a web page, an image or file of some kind, or really any kind of service. It doesn't always even map to a particular object on a particular server. It's really just an address. A URL looks like this, and it's got a number of different parts. The scheme specifies the protocol in use.
Most URLs for web pages will be either HTTP or HTTPS. A scheme is always followed by the :// combination of characters. Host is the host name or IP address for the host server that contains the resource that you're specifying. Port is the TCP port number. It defaults to the default port number for the protocol specified in the scheme field. You normally can omit this and the colon before it. The path field is the path to the object you're specifying.
Typically, this looks like a UNIX file path, and it tends to follow those rules. It always begins with a slash. Keep in mind this is a forward slash as in a UNIX file path; it is never a backslash like you'd find in a Windows file path. Although many servers will allow the backslash, it is always correct to use a forward slash. The query string will be paths to software running on the server. It's typically used for CGI queries. It can provide a number of name-value pairs. The fragment identifier is used to jump to a location within a page or other resource.
Let's look at some examples. These URLs specifies a host name, and the path is the single slash character indicating the root directory. This is often the default if you omit the path. This URL specifies a host name and a path. The path in this case is /contact/. This indicates the default resource in the contact directory at the bw.org host. This is called a relative URL. This specifies the contact directory on the current host.
If you put this URL in a link in a document, the browser will complete it to include the host name of the host for the current document. This is another form of a relative URL. In this case, the web browser will complete it with the host name and directory of the current document. We will take a look at some examples of relative URLs later in this chapter. Understanding the parts of a URL and how relative URLs work is an important part of understanding HTML. You'll need this in order to construct links that work in a variety of environments.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 97336 Viewers
61 Video lessons · 84586 Viewers
71 Video lessons · 68788 Viewers
56 Video lessons · 101265 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.