This chapter is for novice website builders. It reveals an important concept about website building that’s relevant to building your webpages for your webbook.
URLs
URL is the acronym for universal resource locator. Think of the resource as being HTML files (webpages) or media files. Think of universal as being anywhere on the entire web. And think of locator as being the specific and unique web address of any particular webpage or media file.
Typical Webpage
The webpage in this example is on the make-believe website named Enjoy Scenic Southern Colorado. The website address (URL) is EnjoyScenicSothernColorado.com. Below is a webpage of the website called gallery. Its URL is:
http://EnjoyScenicSouthernColorado.com/gallery.html
In this partial view of the gallery webpage, you can see photographs.
Photo
The file name for the top photograph is pagosa-lakes-pano.jpg. Assuming that the photograph file is stored in the same folder on the same hard disk as the webpage, the URL for the photo is as follows:
http:// EnjoyScenicSouthernColorado.com/pagosa-lakes-pano.jpg
This is called an absolute link. It’s absolutely the full and correct web address of the photograph.
Markups
Because the photo file is in the same folder on the same hard disk, you don’t even have to include the URL. You can just name the file without anything else. To embed the photograph in the webpage, you can use the following markups with the filename the following URLs:
<img src=”http:// EnjoyScenicSouthernColorado.com/pagosa-lakes-pano.jpg”>
(absolute hyperlink)
<img src=”pagosa-lakes-pano.jpg”>
(relative hyperlink)
This second link (src) is called a relative link. It shows the resource (photo) relative to where the webpage is (in this case in the same folder in the same storage such as a hard drive).
Absolute links are self-explanatory. However, you need to learn the relative linking scheme to use relative links. There are many online tutorials on it to assist your learning. Read one of them.
Keep in mind If you build your webbook in WordPress, you won’t need the relative hyperlinks that this chapter covers. WordPress does the linking for you. However, if instead you build your webbook in HTML, you will need relative hyperlinks. But you will only need relative hyperlinks if you intend to distribute your webbook in a ZIP file for local use on a user’s device.
Dispersed URLs
Suppose that you keep a huge archive of your photographs at a (make-believe) website named Photo Repository (photorepository.com). Your name is Harrison, which is the name of your account and your folder on the web server. Thus, the URL for the photograph above (assuming it’s stored on this website) is:
http://PhotoRepository.com/harrison/pagosa-lakes-pano.jpg
What’s magic about the web is that you can embed this file in your webpage, even though the file does not exist on the web server that hosts your own website. Thus, the markup for the photo file in any webpage will be as follows:
<img src=”http://PhotoRepository.com/harrison/pagosa-lakes-pano.jpg”>
The magic is simply this. The user’s web browser imports the HTML5 file (webpage) from your website. It imports the photo file from the PhotoRepository.com web server. It assembles these together into a nice webpage for a user to view.
The two web servers providing the HTML file and the media file for the webpage have nothing to do with each other. Different businesses or people own and operate each web server.
Why is this important to know? It’s important because it shows that you can bring in files from anywhere on the web into your webpages. For instance, you may have a huge number of photos that you don’t want to store on the host web server for your website (for whatever reasons). So you store them at PhotoRepository.com. Wherever files are located on the web, through the magic of hyperlinks, you can embed them in your webpage.
Summary
You can store the component files of your webpage anyplace on the web. This goes for HTML files, media files, graphic files, JavaScript files, CSS files, font files, and the like. Via the appropriate HTML5 hyperlinking markups (absolute links) and the appropriate URLs, a user’s web browser can import these various components magically into a fully functioning webpage that a user can view and use.
Nonetheless, if you want to provide users a version of your webbook to users that they can load on their computers and use offline, you need to load the files for the entire webbook into a ZIP file and send users the ZIP file. For such a version, you will need to use relative links instead of absolute links.