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,357
  • 8
  • 29
  • 53
  • 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
  • 857,932
  • 118
  • 1,152
  • 1,264
2

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

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

Curtis
  • 98,395
  • 62
  • 265
  • 345
0

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

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

x13
  • 2,093
  • 1
  • 9
  • 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
  • 13,804
  • 1
  • 24
  • 44