![]() |
anchors I will now show you a Notepad Viewer and resulting Explorer View concerning anchors. |
|
|
![]() |
The resulting Explorer View shows the ways in which hypertext and hypermedia are presented in Internet Explorer 4. |
|
Explorer View 8.1 - click on the
image to see a bigger and clearer version It is also possible to provide a
link to an e-mail address on your page. This can come in useful
if you want to make it easier for people to send comments to you
about your page etc. Instead of having to memorise your e-mail
address they can just click on the link to your e-mail and their
browser will b) prepare the program so as all the user has to do is
This is how to add a link to e-mail on your page: |
|
Send me an <a href= "mailto:youraddress@server.com">e-mail</a> It is very important to remember that "mailto" is one word and that the colon must appear between "mailto" and the e-mail address. If one of the above is left out then the anchor will point to a file on the server (that probably does not exist) and not to your e-mail address.
My browser is Internet Explorer 4 and my e-mail program is Outlook Express. When I click on the word "here" in the above window this is what Outlook Express opens. Click on the image to see a bigger and clearer version Remember, images can also be used as links to e-mail: <a href= "mailto:youraddress@server.com"><img src= "image.gif"></a> internal links Quite often you might want to have a link to another part of your page which is further down or further up the same document. For example a menu at the top of the page and a button at the bottom to return to the top. An internal link requires two tags in the document. |
![]() |
Part a) appears where you want the link to lead and part b) appears where you want the anchor.
When the page is opened it will look like Explorer View 8.3a. Then by clicking on chapter 2 Explorer View 8.3b will open. Explore View 8.3a and Explorer
View 8.3b - click on the images to see bigger and clearer
versions
linking to other files It is also possible to link to other types of files besides other web pages. For example: <a href= "money.gif">money picture</a> Two different things can happen when a link to another file type is clicked,
|
![]() |
An example of a) would be a ".gif" file and an example of b) would be a ".wav" file or a zip file.. A ".gif" file will open in the browser like in Explorer View 8.4 but a ".wav" file will open like in Explorer View 8.5. Explorer View 8.4 If the file being linked to was a zip file the user might decide to save the file to disk. Placing files in zip archives is a common way of compressing files for transfer over the internet. absolute reference Absolute reference is when the full address of a link or embedded object is given. For example, if I was inserting an image as the title for my web-page and I wanted to use absolute reference then this is an example code I could use. <img src= "http://www.mysite.com/images/title.gif"> This can also be used to insert images from another page onto yours without copying them on to your server. relative reference Relative reference is when the address of the link or embedded object is only specified in relation to that page. I will use the example above except this time using relative reference. important in this example I am acting as if the page I am writing is situated in the "homepage" folder. <img src= "/images/title.gif"> |
|
This is the easier way and therefore the most common. Neither way however is more effective, they are just suitable for different situations. It is up to you which one you choose to use. Note that in the notepad viewers of this book I am using relative reference and assuming that the file I am specifying is in the same directory as the html document. When this is the case there is no need to specify any folder at all just simply the name of the file. base href To use relative reference in a document with its base in another folder simply use this tag: <base href= "http://www.mysite.com/homepage/index.html"> Place this tag in the head of your document and all relative references in the document will use this as the primary folder. For example, if you wanted to use an image that was in this folder you would simply specify the name of that image, nothing else, just as if the document itself was in that folder. linking outside the WWW You may have heard of other services available on the Internet besides the World Wide Web. We have already discussed e-mail but other services such as ftp, gopher and telnet can also have anchors in pages on the World Wide Web. To insert an anchor to any of these resources (besides e-mail to which you already know how to link) simply name the address as the HREF in the anchor tag. For example: <a href= "gopher://gopher.mysite.com"> <a href= "ftp://ftp.mysite.com/downloads"> <a href= "telnet://wais.mysite.com"> If you do not understand what any of the above are then it is unlikely that you will want any of them in your page so it does not matter. naming your link You can use the title attribute of the anchor tag to give your links a name. This name can be as long as you want but be careful because I found that if I did not wrap the text in notepad then it did not wrap in Explorer. The name appears in a pop up box when the mouse arrow is held over it for a second or so, the same as the alt attribute of the image tag. Here is an example of the title attribute in action. <a href= "http://www.yahoo.com" title= "why not search for the page you want at yahoo!">
An imagemap is an image that has anchors in different sections of the image. It could also just have one anchor, but the main point of the imagemap is that its anchor(s) are only in a specific area, defined in pixels. uses of imagemaps Imagemaps are mainly used as navigational aids, such as menu bars or attractive homepages but can be used for whatever purpose you can think of. The following three images display three different uses of imagemaps. a) an attractive homepage
b)as a menu bar
c) another use |
![]() |
When I first learned how to use imagemaps I wanted to practice so I designed this:
how to insert an imagemap The first thing you have to do is program the map. The second thing you have to do is assign this map to an image. <map></map> The map starts with the <map> tag and ends with the </map> tag. There is only one attribute of the <map> tag and it is required. It is "name=". This name will be used later when you are assigning the map to an image. <area> Each part of the image that is an anchor is specified with an <area> tag. I will firstly show you a completed <area> tag and then explain each of the attributes. <area shape=rect href= "URL" coords= "0,0,90,75"> shape specifies the shape of the area and can be set to: poly (polygon) circle rect (rectangle) default href specifies the URL that the anchor points to (nohref can be typed instead to signal that this is a dead area in the map) coords contents differ depending on shape coords and shape Each pixel on an image has its own co-ordinates. For example the co-ordinates of the pixel which is 50th from the left edge and 70th from the top are "50,70". This is how imagemaps read co-ordinates. The different shapes however require for a different set of co-ordinates. Rectangle/default top left and bottom right e.g. "10,10,80,70" Polygon each corner e.g. "30,20,40,20,80,50,70,100" Circle centre point and radius e.g. "60,60,30" results
|
![]() |
overlapping If two areas with different URL references overlap then the one which is listed first is the one which the overlapped area refers to. assigning a map to your image To assign a map to an image simply use the attribute "usemap=" in the image tag. Instead of using quotation marks you use the # sign at the start. <img src= "imagemap.jpg" usemap=#mymap> This feature of HTML 3.2 means that you can specify one map at the top of your document and use it in multiple images throughout the document. It removes the need to specify the areas each time you want to insert an imagemap. complete listing
|
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Explorer View 9.1 - click on the image to see a bigger and clearer version ![]() next lesson  home  comment  more downloads  download this |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Notepad Viewer- HTML Builder 6
This is what the top of you HTML Builder should look like now, if displayed in 800x600 pixels. click on the image to see
a bigger and clearer version ![]() next lesson  home  comment  more downloads  download this |
This document was last modified
by the author (above) on 5/12/1998
© copyright 1998