How to Create Hyperlinks
Hyperlinks or "links" are useful for providing resources to visitors of your website. They help to connect your readers with sites that may elaborate or build on your own content. They also help your site get exposure when you are listed on another site as a "link." Once you know the HTML code for creating hyperlinks, it will be easy to add them to your site.
Instructions
-
The Steps
-
1
Select the web address that you want to use for your link. If the web address is outside of your own website an example would be: "http://www.yourlink.com". If the address is within your own website it will contain the link for that page or file. For example, it would be "mypage.html" for a webpage, "myfile.pdf" for a PDF file, or "mypicture.jpg" for a JPEG picture file.
-
2
Add code near the top of your HTML document that describes the color attributes for your links, visited links and active links. The colors can be defined using the color names or values. A list of the colors and values that can be used in HTML can be found under Resources below. The code will look something like this: <body link="cyan" vlink="crimson" a link="cornsilk">
-
-
3
Create an anchor tag and attribute that points to the web page you want to direct people to on your web site. The anchor is identified with "a" and the attribute with "href".
Examples are <a href="http://www.yourlink.com"> for a website, or <a href="mypage.html">, <a href="myfile.pdf">, or <a href="mypicture.jpg"> for a file or page within your own site. -
4
Add a text description that people will click on to go to your hyperlink. This is the text that people will actually see on your web page. Once you've added the text, end the anchor tag with </a>. The HTML code should look like this: <a href="http://www.yourlink.com">Text Description</a> and "Text Description" will show up as a link on your web page.
You can also make an image a hyperlink by adding code that points to a picture instead of text. An example for a picture within your own site would be: <a href="http://www.mylink.com"><img src="mypicture.jpg"></a> or you can point to a picture on another site with this code: <a href="http://www.mylink.com"><img src="http://www.yourpicturelink.com/picture.jpeg"></a>.
-
5
Save your HTML document and test the links to make sure they work properly by clicking them in your browser.
-
1