Click on photos to enlarge.

Thursday, April 4, 2013

HTML Part 5

(See 03-27-13 for HTML Part 4)

Without a doubt, the one thing that has made the Internet such an incredible success revolves around the freedom of choice it offers. In computerese, we call this interactivity. Without it, the Internet experience would be hardly more than an online Yellow Pages or maybe computerized TV. With interactivity, in accessing a Web site, users are immediately confronted with dozens of choices allowing them to wander at will among its offerings. Or, at the click of a mouse, the user can disappear like Spock on Star Trek. And the key to this amazing "cyberportation"? As the Disney song says, "The thingamabob, that does the job" we call the link--or sometimes (if you're really rambunctious) a "hotlink," or "hyperlink." Of course, the other important ingredient in this magical little wonder is the "URL," the Universal Resource Locator, which is, in fact, quite similar to the "online Yellow Pages" I spoke of earlier. Every Web site has a number which is reflected by a lengthy alphanumeric label appearing in quotation marks. Moreover tacked onto the end of this label, making it even longer, can be various pages or images connected with the site, making possible, not only our amazing cyberportation between sites, but within the site as well.

There are three components in a link. First comes the letter "a" which is the abbreviation for anchor. Betcha didn't know that. I'll bet you thought all along it was "anch" or "anc" or maybe just "an." Of course the beloved < comes first. Following the "a" is the reference comment "HREF" followed by "=" and the URL in quotation marks followed by another >. Thus the link looks like:
Actually there is one more element to the link and that is the closing </A>. I've separated this from the main link because the link and its anchor closing tag are both invisible to the browser user. Between them has to appear something for the user to click on. It might be an image (see lesson 4) or simply the plain text words Click here, which would appear underlined, in a different color (often blue) and would, in fact, be the only visible element of the link. Notice there are no quotation marks around the Click here. Any text outside quotation marks will appear "as is" on  the Web page (more on that in Part 6).
What I've outlined above is a link to my Web site which any of you are welcome to include in the code of your own site along with the name of my site or simply my autographed picture, available free upon request. If, however, you simply want to access a different page of your own site, then it's even simpler. Replacing the URL in quotation marks would simply be the title of your page "biography.html", for example, provided that both the "linked from" and the "link to" HTML files are both in the same folder on your Internet Service Provider's (ISP) server. This code would thus read:
If you were accessing a larger version of a painting from what we call a "thumbnail," then the HREF= would be followed by the file name for the full-size image in quotation marks, "MyBIGpainting.jpg" for example, with the image tag for the thumbnail (as discussed in lesson 4) between the link and the closing anchor tag. Thus, the thumbnail link would appear:
(This assumes all files for your site are in the same folder on your ISP's server.) Of course, included within the image tag would probably be some size indicators for the thumbnail image. Don't forget to close the tag with </A>. Google hates it when you skip things like that.

Without a doubt, the link is the most powerful force the HTML writer has at his or her disposal. Using them with style and grace (not to mention a good deal of forethought) makes the visit to your site a genuine pleasure. But nothing on the Internet is more frustrating than links that don't work, except perhaps those that don't work right. In our next excursion into the mysteries of HTML, we'll take as our text the handling of text (which I alluded to earlier in my Click here text).

No comments:

Post a Comment