Ukieweb

Class Notes

Notes for Students

HTML Links

Links are one of the most important parts of websites, the allow us to connect our website with other pages and create the basic connectivity of the internet.

Internal Links

Internal links are links from your current page to other pages in your current website. This requires us to have more than one page in the same directory as our current page.

<a href="myPage2.html">Click here to go to page</a>

External Links

External links are links from your current page to another page on the internet. External links require you to have "http://" in front of the link otherwise your browser will assume you meant an internal link.

<a href="http://google.com">Click here to go to google</a>

Inline/Inner Links

Inline (or inner) links are links from your current page to another point in the same page. This is most commonly seen on wikipedia where you may see a table of contents at the top of a page. This type of link requires 2 parts, a target and a link. The link is the part you click and the target is where you will go once you have clicked. The link must also have a hashtag in front of it otherwise your browser will assume you meant an internal link.

<a href="#gothere">Click here to go to there</a>

<a name="gothere"></a>
If you try this and it does not work, it may be because your page is not long enough to scroll and your target is already in sight.

Activity

Below is an activity to test your HTML knowledge so far. Give it a try.

<html>
	<head>
		<title>Sample Page</title>
	</head>

	<body>

	</body>
</html>
Exercises
  1. Create an internal link to a page called "myPage2.html"
  2. Create an external link to "google.com"
  3. Create a target for an inline link called "gohere"
  4. Create an inline link to go to "gohere"