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.

6
  • Can you display the result also Commented Mar 11, 2019 at 8:55
  • try refreshing the page by using ctrl+f5 Commented Mar 11, 2019 at 8:55
  • like @ZeeshanAhmadKhalil say, try hard refresh using ctrl + f5 and open inspect element and check network tab, are you see your css and js in there? Commented Mar 11, 2019 at 9:00
  • Permissions maybe? Are those files readable? Commented Mar 11, 2019 at 9:08
  • Can you read/open http://whateveryourdomain.is/styles/style.css? Commented Mar 11, 2019 at 10:11

1 Answer 1

1

Try this:

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

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

Sign up to request clarification or add additional context in comments.

4 Comments

Hello Everyone, I tried <link rel="stylesheet" type="text/css" href="../styles/style.css"> but the result seems to be the same. it does link to the CSS stylesheet
I inspected the page and it seems that all of links or JS script are not linked for some reason: GET localhost/akobuy/styles/bootstrap-337.min.css net::ERR_ABORTED 403 (Forbidden) index.php:13 GET localhost/akobuy/font-awsome/css/font-awesome.min.css net::ERR_ABORTED 403 (Forbidden) index.php:14 GET localhost/akobuy/styles/style.css net::ERR_ABORTED 403 (Forbidden)
I think project php run on a server, so how about this: stackoverflow.com/questions/18724718/…
Thanks @thucnguyen !

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.