Hyperlinks, usually referred to simply as "links," are a crucial part of the Internet as a whole and each website in particular. Links allow users to click on a piece of text or an image and be propelled towards another web page. They are therefore integral to the experience of web browsing. Creating hyperlinks as part of your website requires only a short snippet of HTML code. You can create a link quickly by using this code.
Edit Steps
- 1Create the text or image you want to use as a link. Links are created using a simple HTML tag, but first you should create the content that will be placed inside the tag. This can be text, an image, or another HTML element.
- 2Surround the content you created with the tags. Hyperlinks are indicated using a simple tag, closed with the corresponding tag. These tags won't be functional if used without any attributes, but you can add those soon.
- For example, your link might currently look like this: Click here to visit my new page.
- 3Add the "href" attribute to indicate the hyperlink's destination. The "href" attribute tells the browser where to direct the user once the link is clicked. It is followed by an equals sign, which is followed by the destination web address in quotations.
- Continuing with the example above, your link might now look like this: Click here to visit my new page.
- Note that if the link's destination is an external website, you must include the entire URL (which likely begins with "[http"). http").] If only the page name is specified, as above, the current page's directory will be used as the parent directory.
- 4Create an email link using the "mailto:" modifier. To create a link which will begin composing an email message to a particular address, use the "mailto:" modifier just before the person's email address.
- For example, an email link might look like this: Click here to ask a question or voice a concern.
- 5Create anchors within a large web page to be referenced later. If you need to link to a specific portion of a web page, you need to use an anchor. Anchors are useful in large pages with a table of contents; each section of the text can be assigned an anchor to which the table of contents can link. Anchors are created using the "name" attribute.
- To create an anchor, insert the following tag at the appropriate location on the page: Chapter 3 - Using Anchors in HTML
- To link to the anchor you created, use the # sign as follows: Skip to Chapter 3
Edit Video
Edit Tips
- To use an image as a link's content, simply nest the <img> tags inside the <a> tags.
- If you specify an incorrect anchor name, the browser will simply redirect to the top of the page.
Edit Things You'll Need
Edit Sources and Citations
Articles for You to Write
Article Info
Last edited:
November 3, 2011 by AgitatedMuffin
Categories:
Internet
Recent edits by: Rafi Rafat (see all)