Having some static webpage problems

for some reason, on linux i cant directly link files in folders? like i have 2 html files and a css file in a folder in linux, and they seem to all be in different folders when clicked on them and they wont connect together to run the pages, i have tried adding ../ and / and ~ but none if these help link to these files, any clue? sorry if its a lil' vague, i need your guidance and wisdom . Also i know this isnt a zorin exclusive issue per-say but its a linux one none the less.

Yes, if you can go into more detail or perhaps provide screenshots of the files within the folder, let's see if we can help.
Needless to say, linking to or accessing script files is something many of us do, so the solution is likely pretty straight forward.

Specify the path like this:

if you are still not sure about the full path to the file then open the option menu on this directory by right clicking on blank area and Click on open terminal here
now just simply enter pwd

then copy the full path and mention the filename at the end.

1 Like

Good eyes, littlkun.
Yes, your href is set only to the Home directory, but your next screenshot shows your index.html is located in ~/Desktop/thesite

its in desktop/thesite? also is there a way to not specify the exact path as this is a genuine pain in the but and downloading other html projects and php projects means i'd have to rewrite the paths for no reason? Also this means i would have to rewrite the paths when deploying it to an actual webserver...

yeah, or ctrl + l right lol?

The exact path is needed on any platform or architecture. Whether Windows OS, Linux, GnuLinux, Android, MacOS...

There are several things you can do:

  • Use a relative path. The path is defined relative to the current location of the file. You also could add a base tag with your thesite directory in your header, then set yur relative paths to it.
  • Root relative path. Specify the path from the root directory of the website.
  • Dynamic paths. This uses server-side scripting (example: PHP) to dynamically generate paths.

you sure? because on windows i never needed to specifcy the actual full path, it let me link stuff inside the folder and the same logic applies to webservers? So hmmmmmmmmmm, alr.

Yes, I am quite sure.
If you link a relative path (Which I also do in creating gtk themes), it can find the elements.
But if you link outside of a relative path or outside of the directory - as you are doing above - then it cannot know by itself which folder to look in.
You linked to your home folder, not to the directory containing the file.
You also did not begin in that directory and link outward to the elements or files. So in either case, it won't know where to look.

So I just tried this today without specifying the full path to the css file and it still worked fine for me.

Don't know why your browser showing different file paths to both of the html files.

  • place all the html files in same working directory
  • in your browser's url bar type this file:///home
  • then navigate to the folder containing the html files & open the base html file

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.