Linking To Pages Within Your Site

The anchor element, which is used to create links within your sites. you might think that you would need to use the link element, but no the link element is used to request external resources for the page. To create a link on the page, you use the anchor element. Its syntax is fairly easy to grasp. You surround the content that you want to make into a clickable link with an anchor tag. Next, you add an href attribute that tells the browser where you'd like it to go when the link is clicked.

Linking To External Pages

Another very common function of links is to redirect users to pages and sites that are external to the site they're currently on. These are referred to as GLUT links. In order to link to an external site or page, you'll need to know the full URL for that site.

Linking To Downloadable Resources

Occasionally you may want to give users the ability to download a file or some type of resource from your site. In certain cases, for security reasons, for example, you may need to occasionally have scripting help you out with this but most of the time you can do it by just using simple link syntax combined with the new HTML5 download attribute.

Linking To Page Regions

In addition to linking to external pages and sites, anchors allow us to jump to specific sections within a document as well. These are known as fragment identifiers and can be extremely helpful in enhancing the navigation of your site.

Link Example Code

            <a href="https://www.w3schools.com">Visit W3Schools.com!</a>
            <a href="MyIndexFile.html">Understanding Your Market</a>
            <a href="http://example.com/files/myfile.pdf" target="_blank">Download</a>