A Guide to Using External HTML Links

What the Code Looks Like

Adding HTML External Links. kr7ysztof / Getty Images

When creating a website, there are several things you MUST have on each Web page. HTML links are one of those things. HTML links do a variety of things for your website. Without HTML links you can't have a "website" and you can't show your visitors more information on the subjects that you are interested in and want to talk about.

There are 3 major types of HTML links; external links, internal links, and links within the same page.

Adding each of these types of HTML links to your Web page is done a little bit differently.

External HTML Links

External HTML links are those HTML links that go to another website. If you place HTML links to About.com, or another website you like, on your Web page that would be an example of external HTML links. Having external HTML links on your website is very important because if you have a good set of HTML links that your visitors are interested in it will keep them coming back to your website to access those HTML links. For example, if you have a set of HTML links on Star Trek and they really like Star Trek then it would be much easier for them to come to your website than to go looking through a search engine for the sites they want. They may even bookmark your Web pages so they can get to your HTML links faster thus resulting in more page views for you. If they like it that much they may even tell their friends about your pages of HTML links and their friends will place HTML links to your website from their website.

Result: even more page views.

The code for external HTML links looks like this:

<a href="http://www.sitename.com"><b>Text for HTML links goes here.</b></a> Anything extra you want to write goes here.

So if you where putting HTML links to my homepage it would look like this:

<a href="https://www.lifewire.com/web-and-search-4102742​"><b>Web & Search Tips</b></a> - Your place for links to personal Web pages.

This is what HTML links will look like on your Web page:

Personal Web Pages - Your place for links to personal Web pages.

Now I am going to break this down for you so you understand it better:

<a href= - tells your browser to start HTML links.

"http://www.sitename.com" - is the HTML link itself and must be closed with another >

Text for HTML links goes here. - is where you put the text that you want someone to click on to go to HTML links.

</a> - closes HTML links and tells your browser to go back to text mode.

<b> and </b> - tell your browser that you want the text in between these two codes to be in bold letters. You do not need to use this if you don't want your text in bold.

Anything extra you want to write goes here. - this is a good place to describe the place that HTML links will bring your visitor to.

The same page HTML link is the HTML link that goes from one point on your Web page to another point on the same Web page. For example, if you are on the bottom of a Web page and there is an HTML link that takes you back to the top that is an example of a same-page link. Another use for this type of link is a table of contents.

The code for a same-page link has two parts; the link and the hook.

The link is, of course, that part that tells the browser where to go when the user clicks on it. The hook is what the link looks for and how it knows where on the page to go.

You need to create the hook first. You can't set up a link until you know what address to put in the link so the browser knows where to go. You need to give your hook a name and you should put the link around text. In the following example, I named the hook "top" and placed it around the title of the page to take the user back to the top of the page. The code for the hook looks like this:

<A NAME="top">Title Of The Page</A>

Now we can create the link. In the link we use the same name. This is what tells the browser where to go, it will now look for the hook called "top". This is what the code for the link looks like:

<A HREF="#top">Back To The Top</A>

More From Us