Tuesday, January 24, 2017

Hypertext - The Link That Binds

Links

If you really want to make your website useful, you need to add links using an <a> element.

This is an example of a link. or it looks like this in html: <a href="#">This is an example of a link.</a>

The href is an attribute that tells the browser the destination of the link you created. While the "#" would be where you put the actual destination. This can be to an actual website (you will need to include the http://) or it can be to another file on your server. I used the "#" because it is a link that I will update later.

For practice let's create a link to Google with text that reads: Search Engine.

This is what it should look like: Search Engine

So how did I do that?

Here is the html version:
<a href="http://www.google.com">Search Engine</a>

Alright, so what if we only wanted the word Search to be a link like this: Search Engine?

Then you would simply move the word "Engine" outside of the <a> element like this: <a href="http://www.google.com">Search</a> Engine

Now that we know how to link websites to each other go practice adding different links to your website. The next post will help you understand how to link your own files together that are hosted on the same server.

No comments:

Post a Comment