Knowledgebase
Musewidgets.net > Musewidgets Help Desk > Knowledgebase

Search help:


What is the difference between an absolute and a relative URL?

Solution

 

An absolute URL contains more information than a relative URL does. Relative URLs are more convenient because they are shorter and often more portable. However, you can use them only to reference links on the same server as the page that contains them.

 

Linking with absolute URLs

An absolute URL typically takes the following form:

 

protocol://domain/path 

 

The protocol is usually, http://  but can also be,https://ftp://, gopher://, or file:// The domain is the name of the website. For example, the domain name of Indiana University's central web server is www.adobe.com. The path includes directory and file information. You must use absolute URLs when referring to links on different servers.

 

Linking with relative URLs

Relative URLs can take a number of different forms. When referring to a file that occurs in the same directory as the referring page, a URL can be as simple as the name of the file. For example, if you want to create a link in your home page to the file, foobar.html which is in the same directory as your home page, you would use:

 

 

<a href="foobar.html">The Wonderful World of Foobar!</a>

In the Muse Widget write in the link option:

 

 

 

If the file you want to link to is in a subdirectory of the referring page's directory, you need to enter only the directory information and the name of the file. So if foobar.html were in the foobar subdirectory of yourwww/directory, you could refer to it from your home page by using: 

  <a href="subdirectory/foobar.html">The Wonderful World of Foobar!</a>

 

 

 

If the file you want to link to is in a higher directory than the referring page, use  .. sintax, whichmeans to go up a directory. For example, to link from foobar.html to  home.html, which is in the directory above, you would use:

  <a href="../home.html">Go back to my home page</a>

 

 

 

Anchor page

 

Linking to anchors is very similar to normal links. Normal links always point to the top of a page. Anchors point to a place within a page.

A # in front of a link location specifies that the link is pointing to an anchor on a page. (Anchor meaning a specific place in the middle of your page).

To link to an anchor you need to:

 

  • Create a link pointing to the anchor

  • Create the anchor itself.

HTML Syntax:


An anchor is created using the <a> tag.


If you want to create an anchor called myAnchor , you simply add this line where you want the anchor to be:

<a name="myAnchor"></a>

 

After doing this, you can make a link pointing to the anchor using the normal <a href> tag, like this:

 

Click <a href="#myAnchor">here</a> to read chapter 4.


When linking to an anchor on a page you need to put a # in front of the anchor.

When you link to an anchor on the same page, simply enter

<a href="#myAnchor">blabla</a>


When you link to anchors on external pages use this syntax:

<a href="http://www.mySite.com#myAnchor">blabla</a>


Anchors are generally used when you create pages with considerable amounts of text. You would typically make an index at the top of the page linking to the anchors that have been added to key places in the text that follows.

 

Adobe Muse Syntax

Select object menu and click insert anchor link.

Rename the anchor link, example myAnchor.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Select the widget and write in the URL box # myAnchor

 

 
Was this article helpful? yes / no
Article details
Article ID: 2
Category: Widgets
Date added: 2017-09-14 11:20:38
Views: 198
Rating (Votes): Article rated 5.0/5.0 (1)

 
« Go back