Eye of Design helps users find information on web design and development along with feature a gallary of works created by Gary R. Hess.

Linking in HTML

Links are very important for not only just navigation of a website, but navigating the world wide web as a whole. Links allow you to go from page to page, site from site, frame to frame, open new windows or even download files. Links are as old as the web and they will stay around as long as the web.

Link to another page within your website
There are a few different codes you should remember when placing links within your own website. The first of which would be to another page that is in the same folder as the others. For example: <a href="url.htm"> with </a> at the end of the link. <a href="url.htm">cows</a>.

However, if the file is in another folder it gets a little trickier, but nothing you can't pick up quickly. <a href="../url.htm">cows</a> will bring you down one level then to the file 'cows.' The '..' does the trick. It tells the server to go down one level.

If you wish to go up one level, you simply put the folder name infront of the file name with / infront of the filename. Example: <a href="animals/cows.htm">cows</a>. This link will have the server go to the level animals, then to the file cows.

You may also put the two together to make the server go down one level then to the folder and to the filename. Example: <a href="../animals/cows.htm">cows</a>.

Using anchor tags
If you wish to use anchor tags (They allow you to press a link and then it scrolls down or up to a specific point or if its from another page it brings you to a specific point on the other page) you may use <a href="#name"> when it is within the same page or <a href="filename.htm#name">.

However, in order to use an anchor tag you must first set the anchor. And to do this you may use either id or name (id is recommended, because name is not supported in strict versions of HTML). As an example: <a id="anchorpoint"></a>. id may also be used in other tags. See id for more information.

Setting targets
If you want to open a link in a blank page or a frame, you need to use <a href="url.html" target="name"> where name equals either _blank (which opens a new page) or the name or id of the frame.

Link to download files
Setting a link to download a file is quite easy. All you do is set a link to the file to download. Example: <a href="file.zip">file</a>