![]() ![]() ![]() ![]() | ||
![]() ![]() |
|
LJS International Beginners HTML course Lesson 3: Linking on webpages. Linking or joining of pages on the www can be done in several ways.
This would show a pic of me that you could click on,
to go to my LJS International site.
The graphic would have to be uploaded to the psped site
and located on the main directory of the psped site.
I like to organize my directories seperate
so that I can locate easily when I'm looking at the file system of my site.
So I make a directory of Images within the main directory,
just for graphic storage.
In that case the link would have to tell the browser
exactly where to find the lala.jpg file...like this
This tells the browser:
first to link to ljsoroka.ca website
and to link the image (
This would tell the browser to link to ljsoroka.ca site
in a new blank window using the image lala.jpg to show as the link image.
You can also add in attributes to tell the browser the exact size
in pixels of the graphic that you are using to link with.
Doing this helps the page to load faster
as the browser doesn't have to read the size of the image file ...
it is told how big to show it.
The size attribute would be placed within the image part of your anchor tag...
like this
In any tag, be it for linking or otherwise you have many attributes
that you can add to tell the browser specific things.
Many of these attributes can be found on the cheat sheet
that I sent to you, or online if you were to search for html tags :)
There is one more attribute that I use on most every image link
or any image tag for that matter and that is the alt attribute
This tells the browser what the image is ...
so that when your visitor puts thier cursor on the image
it will show a little box of text with a description in it.
Like...picture of lala or link to lala's Web Designs site
or what ever you want it to say.
This is good practice to have in your html design
as it helps those visitors who don't have image capability
know what the image is or the link is :)
This alt attribute looks like this:
alt="my home page"
and is placed within the image tag after the size attribute
and befor you close > the image tag.
Next lets talk about the linking between two pages on the same site.
Linking two pages on your own site is done in the same way
as linking to another site; however, a few changes need to be made
for example in the link or anchor tag
you don't have to have the absolute path...
you can just use the / to have the browser locate the image file.
or the page.
Like this:
This would tell the browser to look in your own directory
for the page aboutme.html and for the image lala.jpg.
All the same attributes as above in the linking to another site apply
to linking within your own site.
You can also link to another graphic ON YOUR OWN SITE using anchor tags.
For example...if you have a smaller picture
to save loading time and space ( a thumbnail picture)
you can link that to open in a new window
to a larger version to be viewed.
This is accomplished but using the target tag
as we discussed earlier in this lesson.
You would have to have both the thumbnail picture
and the larger version picture
located in your site directories on the web server.
here is an example of such a link...
This tells the browser to link the image lala10-1.gif in a new window
but to use the thumbnail ... tn_lala10-1.gif
to show as the link to click onto.
You can see a sample of this on my psped site page here:
http://psped.com/Challenges/ChallengeTheaterGallery2002.html
Click onto the mask image (called tn_lala10-1.gif )
and it will open in a new window
to the larger version( called lala10-1.gif
Now for linking email :)
I'm sure you have seen on many sites.. a link line of text
that says Send Email or an image for you to click
to email or contact the person.
The anchor tag for email is very different from the page link tags.
It still uses the tag; however,
the location is much different.
We want to tell the browser to locate the email program
on the visitors system and open it to write an email to you.
So the link would be like this:
Contact Me
This link tells the browser to link to the persons email program on thier system
and open a send mail file to write the email in.
It will also have the Email address that you are sending to
placed already in the to: line of the email :)
that's where the psped mail address would come in..
so it's important to have that in your link.
Then the browser reads to put text on the page that says
Contact Me as the link text and to then close off the anchor
with the tag.
Again here you may use an image
to link to the contact through an email anchor.
You would add in the location of the image
to be used within your site.
|
| This html Lesson is Copyright © LJS International All Rights Reserved It my not be copied in any form Without permission from the author. |
| Website content and Graphics are Copyright ©LJS International, 2006 All Rights Reserved International Copyrights Apply |