1

What will the below lines of code ? How will they search for the cover.css file?

<link href="./css/home.css" rel="stylesheet">
<link href="../css/cover.css" rel="stylesheet">

I think ./ looks for the current directory and ../ looks for the entire drive. Am I correct?

yshavit
  • 42,327
  • 7
  • 87
  • 124
  • `../` should represent the parent directory, not the entire drive, in typical system. What is your OS of the system? – MikeCAT May 01 '16 at 09:05
  • 1
    I'm going to remove the `java` and `jsp` tags from this, since this question doesn't seem to have anything to do with either (other than, presumably, that the HTML you've given is some that you're generating using jsp). This actually doesn't even look like a CSS question; it's an HTML question. But I don't know what the conventions are for the `css` label on Stack Overflow, and whether they include the HTML that brings the CSS in. I'm also going to tag this as `html`. Please feel free to revert any of that if you think I've made a mistake. :) – yshavit May 01 '16 at 09:11
  • My OS is windows 7 – Bineet Kumar Nayak May 01 '16 at 09:16

1 Answers1

0

The first one, searches for the directory css in the current working directory.

In the second case it searches for the directory css in the parent directory of the current working directory. The functionality is similar to cd .. in unix command line which is used to go to the parent directory.

Shubham Khatri
  • 270,417
  • 55
  • 406
  • 400