Solved

What is ./ in HTML?

Posted on 2009-04-08
8
207 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
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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 3

Assisted Solution

by:GarthSnyder
GarthSnyder earned 50 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 50 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 150 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
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 …
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…

861 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