Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Do Not UnderStand Main Root File & Links?
Old 08-26-2007, 10:40 PM Do Not UnderStand Main Root File & Links?
Average Talker

Posts: 23
Name: jade
Trades: 0
How do you link the Main file with the other files? I am having troble linking pages?understanding how to href ?
staron is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-26-2007, 11:20 PM Re: Do Not UnderStand Main Root File & Links?
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Jade it depends a little on where your pages are so I won't be able to give you an exact answer, but I'll try to explain things as best as I can.

Chances are you have a folder called public_html or htdocs where all your files are. It may be called something else, but those are fairly common. These would be your root folders.

Lets say below that folder you add another folder called 'images' where you place all your images.

And lets say you create two pages for your site:

index.html
about-us.html

And you place both files in the root folder. Lets say you also have images that you place in your images folder

logo.gif
photo.jpg

Ok so now for the links. If you want to add a link from your index page to your about page there are several ways you can do it. One is using an absolute path.

a href="http://www.yourdomain.com/about-us.html"

When you have a slash at the end of the domain .com/ that's pointing to your root folder. In this case the about-us file is in the root folder.

If you want to link to an image from your index page in the src of an img tag say the absolute (or full path) would be

src="http://yourdomain.com/images/logo.gif"

In this case the image is one folder deeper into the site. Your images folder is inside the root folder and your image is inside the images folder.

Each / will represent one folder deeper into your structure.

You can also use relative paths. In the case of linking from the index page to the about page you could write

a href="about-us.html"

Using a relative path assumes your starting from the folder where the file currently resides. Since the index file is in the root folder all the stuff that would point to your root folder http://www.domain.com/ is assumed and you can just start with what would come after.

Linking to an image with a relative path from your index file would look like

src="images/photo.jpg"

Now lets add one more folder. Say you have a folder called services where you have a few pages for your different services. Maybe you have files

consulting.html
design.html
marketing.html

Linking from the index.html file to one of these files is similar to the way we linked to the images

a href="services/design.html'

If you wanted to link from your design page to your marketing page the link might be

a href="marketing.html"

Since both files are in the same folder.

Now if you wanted to link from your design.html page to your about-us.html page you could link using the absolute path which would look just like it did when you linked to that page from the index.html page. The absolute path to a file is always the same and again you would have

a href="http://www,yourdomain.com/about-us.html"

If you want to use a relative path it's little trickier, but not much. In this case we need to go back up the folder stucture since your design.html page is one level below the root. Two dots .. represents the parent folder so

a href="../about-us.html"

says go to the parent folder (The parent folder of the services folder here is the root) and then find the file about-us.html.

I hope that helps, but please feel free to ask more questions. Once you do this a few times I promise it gets easier and becomes second nature.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 08-27-2007, 10:59 AM Re: Do Not UnderStand Main Root File & Links?
Average Talker

Posts: 23
Name: jade
Trades: 0
thank you,so much
staron is offline
Reply With Quote
View Public Profile
 
Old 08-27-2007, 06:49 PM Re: Do Not UnderStand Main Root File & Links?
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Glad to help Jade. Please come back and ask more questions though if you need more help.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Reply     « Reply to Do Not UnderStand Main Root File & Links?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.14228 seconds with 12 queries