Just for curiosity.
What is the better method to use and what is the difference between them ?
<link rel=stylesheet href="./css/css.css">
vs
<link rel=stylesheet href="css/css.css">
This is where the dot slash ./ notation comes in. It means “Look in the current directory.” When you use ./, you tell Ubuntu or Fedora or SUSE or whatever Linux distribution you're using to look in the current directory for the command you wish to run, and completely ignore what's on the application PATH.
A dot slash is a dot followed immediately by a forward slash ( ./ ). It is used in Linux and Unix to execute a compiled program in the current directory.
.. (dot dot) This refers to the parent directory of your working directory, immediately above your working directory in the file system structure. If one of these is used as the first element in a relative path name, it refers to your working directory.
The dot is the current directory and the slash is a path delimiter.
In a relative URI, there is no difference between them.
Going without the ./
will save you 2 bytes, so it is marginally better.
In a UNIX style shell, leaving the ./
off will search $PATH
while including it will search the current directory. Some people might be including the ./
out of habit from working on the shell.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With