0

I came across this problem while studying PHP, when i created a Folder and a file inside of it such as pages/page.php

I added include but it did not read the CSS files, i had to go in and add " ../ " ../css/file.css

Is there any other way to let it read the CSS without adding it twice, one with ../ and one without it, so my sub-folders have a functional CSS?

I have TTS dyslexia, sorry If my explanation is hard. I tried my best.

Thank you in Advance

  • Subfolders probably aren't really necessary, unless for some reason you have a huge number of pages in your site. – ADyson Dec 05 '21 at 19:34
  • @ADyson We will be having large numbers of pages. – Chloe Lola Dec 05 '21 at 19:38
  • Define "large". Any particular reason? Maybe it's time for a CMS then, instead of static pages? – ADyson Dec 05 '21 at 19:45
  • @ADyson still havn't reached CMS, I am just working the project to add every project i made inside project page. – Chloe Lola Dec 05 '21 at 19:49
  • No I mean you should start again and build your site using a CMS framework instead of adding lots and lots of individual pages – ADyson Dec 05 '21 at 20:46
  • You could use root relative path as discussed here: https://stackoverflow.com/questions/5559578/having-links-relative-to-root – schmauch Dec 05 '21 at 21:19
  • @schmauch I did try using /include/head.php it didnt work for both index.php and subfilder – Chloe Lola Dec 05 '21 at 22:16

0 Answers0