?
Solved

What is ./ in HTML?

Posted on 2009-04-08
8
Medium Priority
?
211 Views
Last Modified: 2012-05-06
Hi All,

Simple HTML question.

What does  ./  do in HTML

-i.e.


<a href="./index.html">index</a>
0
Comment
Question by:detox1978
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 7

Expert Comment

by:gudii9
ID: 24102711
it basically maps URLs to Filesystem locations ( references based on root, user directory etc)
0
 
LVL 2

Author Comment

by:detox1978
ID: 24102719
That's what i thought, but i'm using a PHP script and it returns file not found?


Any ideas why?
0
 
LVL 2

Author Comment

by:detox1978
ID: 24102725
Sorry i should have said, it stays with the folder instead of going to the root....

any ideas why?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Assisted Solution

by:GarthSnyder
GarthSnyder earned 200 total points
ID: 24102850
In short, the "./" does nothing.

This is really a URL question, not an HTML question, and URLs follow UNIX path semantics. In that system "." is the name of the current directory and / is just the path separator. So "./index.html" is completely equivalent to "index.html".

If the file isn't found, make sure the current HTML BASE is really pointing at the parent URL of that index.html file.
0
 
LVL 16

Assisted Solution

by:hankknight
hankknight earned 200 total points
ID: 24103374
"./index.html" is equivalent to "index.html" however ./ is not useless and redundant.  Use ./ when you want to go to the index of the current directory.

For example, this could NOT be done any other way than with ./:
    <a href="./">Index</a>

0
 
LVL 3

Accepted Solution

by:
Duboux earned 600 total points
ID: 24103582
In easy language:

./ stands for the current folder the page you're looking at in your browser is also in.
../ is a folder above it.
../../ is the folder above that one..

for example, the script/page you're linking in, is in this folder:
folder1 / folder2 / folder3 / your_page.html
./ = folder1 / folder2 / folder3 /
../ = folder1 / folder2 /
../../ = folder1 /

it's tidy to use ./
but defenately not necessary ;)
0
 
LVL 13

Expert Comment

by:qwerty021600
ID: 24105522
See if you want to refer to an image which is separate folder. For Example
You have this folder structure :
One folder which contain all the images and CSS.

So if in a class in CSS, you refer to any background image. you'll give the path ./ for the image as the CSS and image are in the same folder.
0
 
LVL 2

Author Closing Comment

by:detox1978
ID: 31568299
thanks,
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

765 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