Many people have difficulty linking their webpage to other webpages and media. In this article, you learn how to create relative links from any webpage to any other webpage in a directory structure, even to a specific location in another webpage. Plus you learned about a couple of useful link tag attributes.
Welcome to Bucaro TecHelp!

Welcome to Bucaro TecHelp!
Maintain Your Computer and Use it More Effectively
to Design a Web Site and Make Money on the Web

About Bucaro TecHelp About BTH User Agreement User Agreement Privacy Policy Privacy Site Map Site Map Contact Bucaro TecHelp Contact Advertise on Bucaro TecHelp Advertise Here RSS News Feeds News Feeds

HTML5 Solutions: Essential Techniques for HTML5 Developers

Essential Techniques for HTML5 Developers

HTML5 brings the biggest changes to HTML in years. Web designers now have new techniques, from displaying video and audio natively in HTML, to creating realtime graphics on a web page without a plugin.

This book provides a collection of solutions to all of the most common HTML5 problems. Every solution contains sample code that is production-ready and can be applied to any project.

Click Here

HTML Linking Basics

There are many "wysiwyg" webpage design applications that let you create a webpage as easy as typing text. But many people have difficulty linking their webpage to other webpages and media. The stumbling block is knowing how to use absolute and relative links to webpages and media files.

In this article you'll learn how to use absolute and relative links to link to webpages and media files in the same folder, different folders, different websites, and even to specific locations within the same webpage or a different webpage.

Use the <a> tag to create an html link. The basic <a> tag has the href attribute, which specifies the protocol (http), URI (path) to the target object, and the link text, as shown below.

<a href="http://bucarotechelp.com/default.asp">Bucaro Techelp</a>

-  URI stands for Uniform Resource Identifier, which used to be called the URL (Uniform Resource Locater). Why they changed it, I don't know. I'm sure there's some subtle difference between URL and URI, in either case, it's the address of the webpage or media file that you want to link to. A URI cannot have spaces or certain other characters and, unlike Windows paths, uses forward slashes rather than "backslashes" to denote different directories.

For instructional purposes, let's assume that the file name of your webpage is mypage.htm and that it's located in a subdirectory named content of your website which has the domain name www.mydomain.com. The location of your webpage is then:

www.mydomain.com/content/mypage.htm

Therefore, anyone who wants to link to your webpage would use the link shown below.

<a href="http://www.mydomain.com/content/mypage.htm">Link Text</a>

Now, let's assume that you create another webpage named page2.htm and place it n the same folder as mypage.htm. A diagram of the directory structure is shown below.

[content]
  mypage.htm
  page2.htm

Let's further assume that you want to place a link in mypage.htm that loads page2.htm. The code for this link is shown below.

<a href="http://www.mydomain.com/content/page2.htm">Page 2</a>

The link shown above is an absolute link because it contains a fully qualified URI, in other words, the complete path to the webpage. You can always use an absolute link to link to other webpages or media.

The base URI of a webpage is its URI minus the file name. Both webpages have the same base URI: www.mydomain.com/content/. So you could use a shorter relative path in the link. The code for a link in mypage.htm to page2.htm using a relative path is shown below.

<a href="page2.htm">Page 2</a>

RSS Feed RSS Feed



Web Design Sections

HTML5 for Masterminds

HTML5 for Masterminds

How to take advantage of HTML5 to create amazing websites and revolutionary applications

This book is not an introduction of HTML5 but instead a complete course that will teach you how to build compelling websites and amazing web applications from scratch. Every chapter explores basic concepts as well as complicated issues of HTML5, CSS3 and Javascript.

Concepts are supported by fully functional codes to guide beginners and experts through every single tag, style or function included in the specification.

Click here for more information.


[Site User Agreement] [Advertise on This site] [Search This Site] [Contact Form]
Copyright©2001-2011 Bucaro TecHelp 13771 N Fountain Hills Blvd Suite 114-248 Fountain Hills, AZ 85268