0

I am storing style sheets in {root}/styles while images in {root}/images for a website.

  1. what is difference between ../ and ~/. ?
ozil
  • 6,930
  • 9
  • 33
  • 56
  • This question is pretty vague. `~/` seems to only have a meaning at all in some specific contexts, none of which are identified in the question. – Peter Herdenborg Oct 01 '15 at 09:16

4 Answers4

6

../ references the parent directory.

~/ has no special meaning in standard URLs. It does have special meaning in

  • ASP.NET where it references the root of the application
  • UNIX shells where it references the current user's home directory
Community
  • 1
  • 1
Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
2

../ is relative to the current path of the file.

~/ is relative to the root of the application (in ASP.NET).

Curtis
  • 101,612
  • 66
  • 270
  • 352
0

../ goes up one dir from the current dir.

~/ goes to the dir where you originally came from (not usable in html).

x13
  • 2,179
  • 1
  • 11
  • 27
0

Depends on the framework you are working on.If you have ASP.NET context ~/with ResolveUrl refers to the root level directory, ignoring the sub directories as well.

In CSS we navigate to the previous directories using ../. If you use ../../ you navigate to two steps back and so on.If you use ./, you can reach to the root

Tushar Gupta
  • 15,504
  • 1
  • 29
  • 47