Reputation: 7117
I am storing style sheets in {root}/styles while images in {root}/images for a website.
../
and ~/
. ? Upvotes: 0
Views: 143
Reputation: 15923
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
Upvotes: 0
Reputation: 2227
../
goes up one dir from the current dir.
~/
goes to the dir where you originally came from (not usable in html).
Upvotes: 0
Reputation: 943579
../
references the parent directory.
~/
has no special meaning in standard URLs. It does have special meaning in
Upvotes: 6
Reputation: 103348
../
is relative to the current path of the file.
~/
is relative to the root of the application (in ASP.NET).
Upvotes: 2