Solved

What does this mean, as far as a reference to a URL?

Posted on 2015-01-02
3
133 Views
Last Modified: 2015-01-02
If I'm documenting a relative URL, in other words, I'm not documenting it as "http://www.whatevercom," then I'm going to use a combination of characters so my user will be routed correctly when the click on the link.

If the file is sitting in the current directory, then my relative URL would look like this:

"myfile.htm"

If it was sitting in a directory one level up from my user's current location, then that URL would look like this:

"../first_folder/myfile.htm"

And just to be clear, here's my hierarchy:

root
anotherfile.htm
     first_folder / myfile.htm
     second_folder - my user's current location
          second_subfolder

...and if my user wanted to access "anotherfilehtm" in the root directory, based on my architecture I've got above, then my URL would look like:

"../../anotherfile.htm"

Cake and ice cream, right? Basic stuff. But now I'm looking at another programmer's code and they their css file referenced like this:

<link rel="stylesheet" href="/css/AreaBasePage.css" typr="text/css" />

I'm stumped! I've never seen a file name prefaced with anything other than "../" or something similar. Where is my file located if it's referenced as "/myfile?"
0
Comment
Question by:brucegust
3 Comments
 
LVL 24

Assisted Solution

by:Phillip Burton
Phillip Burton earned 100 total points
ID: 40527938
It is located in a subfolder where the HTML file is located.

So if the HTML file is located in root/first_folder, then it is in root/first_folder/css.
0
 
LVL 26

Assisted Solution

by:Shaun Kline
Shaun Kline earned 100 total points
ID: 40527940
When you start a URL reference with a slash (/), the URL is referenced to the root of your website. In your example, there is a CSS folder at the root with the .css file in it.
0
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 300 total points
ID: 40527941
"/myfile"  - Root of the site
"myfile" - Relative to current page
"../myfile" - Up one directory from current page
"./myfile" - Relatieve to current page
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
updateParent() HTML Javascript 21 61
Tag input html 4 38
Urgent need help ASAP With CSS 5 21
Bootstrap 3 icons 3 11
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now