0

I saw the below head section in a page and I don't understand the purpose of the ./ before the stylesheet call. I checked the directory for the site and the stylesheet is in the same directory as the index page.

<head>
    <meta charset="utf-8">
    <title>Site Title</title>
    <link rel="stylesheet" type="text/css" href="./styles.css">
</head>
Millhorn
  • 2,953
  • 7
  • 39
  • 77
  • 1
    `.` means current directory. – Irfan434 Oct 30 '17 at 05:26
  • 1
    Purpose of ./ before call to a stylesheet? It no way effects the directory if u remove that nothing happens and if u use that then the same nothing happen. But in case u remove / that means the file would use as .style.css. Which is wrong. – Harden Rahul Oct 30 '17 at 05:35

1 Answers1

1

. refers to the current directory (that the HTML page is in) and ./styles.css refers to a file called styles.css in the current directory. See here for more info https://stackoverflow.com/a/24340516/8595398

Matthew
  • 1,630
  • 1
  • 14
  • 19