| :: code war·ri·or | ||||||||||
|
|
|
|
| home :: html tutorials :: site building :: q&a :: resources :: shop |
|
Internal Links As well as linking to external files, you can link to specific locations within the current page. All you do is mark the locations and add the links. Internal links are best used on pages with lots of information. You may well have seen it on a FAQ page, where the questions link to their answers. Decide where you want to link to, and add the following to the code: Again it's the A tag we're using, but no HREF this time. The NAME attribute lets you name this location - something more descriptive than location1 would be a good idea though. Perhaps try Top for the top of your page and the names of the headings on the way down the page. This is how we'll be referring to this location later. You still need a closing A tag, but you don't necessarily need to put a description in. Sometimes you'll want to, sometimes you won't - it doesn't matter, since this A tag does not change the appearance of the text at all, but it may make it easier when you come to amend your code at a later stage. Linking to your Markers Now you've added your marker, you just need to link to it. We again use the A tag, this time with HREF and the name of the marker (preceded by a #) as the path: <a href="#location1">Click here to jump to location 1</A> Click here to jump to location 1 Linking from other Files You can also link to these markers from external files - i.e. link to a specific point in another document. Set up the markers and link to the file as usual - just add a # and the marker name to the path: <a href="../myfile.html#location1">Click here to jump to location 1 in myfile.html</A> Click here to jump to location 1 in myfile.html Whenever you create links (internal or external) the spelling and case of the path must be correct. Although your computer is probably not case sensitive when you have uploaded your files they are. This is why in the basics tutorial we said to use all lower case. The most common cause of problems with links is in their case, so check all your links as you make them. Now we will move onto Images |
· code-warrior |
| home :: html tutorials :: site building :: q&a :: resources :: shop |
|
|
|
|
|
|