0

For some reason I can't link my files and external stylesheet, external JS files to my index.php file.

I have linked index.php to style.css from the directory akobuy > styles folder:

enter image description here

I tried several options but it doesn't seem to load the stylesheet:

 1. <link rel="stylesheet" type="text/css" href="styles/style.css">
 2. <link rel="stylesheet" type="text/css" href="/styles/style.css">
 3. <link rel="stylesheet" type="text/css" href="./styles/style.css">
 4. <link rel="stylesheet" type="text/css" href="../Akobuy/styles/style.css">

Same is happening with JS and images:

enter image description here

I tried several other editors same issues.

brombeer
  • 8,716
  • 5
  • 21
  • 27

1 Answers1

1

Try this:

<link rel="stylesheet" type="text/css" href="../styles/style.css">

Related with your images. ../ mean back to parent.

Thuc Nguyen
  • 235
  • 2
  • 8
  • Hello Everyone, I tried but the result seems to be the same. it does link to the CSS stylesheet – Joel Lienard Mar 12 '19 at 07:53
  • I inspected the page and it seems that all of links or JS script are not linked for some reason: GET http://localhost/akobuy/styles/bootstrap-337.min.css net::ERR_ABORTED 403 (Forbidden) index.php:13 GET http://localhost/akobuy/font-awsome/css/font-awesome.min.css net::ERR_ABORTED 403 (Forbidden) index.php:14 GET http://localhost/akobuy/styles/style.css net::ERR_ABORTED 403 (Forbidden) – Joel Lienard Mar 12 '19 at 08:00
  • I think project php run on a server, so how about this: https://stackoverflow.com/questions/18724718/error-403-in-loading-resources-like-css-and-js-in-my-index-php – Thuc Nguyen Mar 13 '19 at 01:39
  • Thanks @thucnguyen ! – Joel Lienard Mar 22 '19 at 13:02