CodePen is a place to store html, CSS, and JS code all together to create a webpage. It’s a beginner alternative to share code without more complicated “pro” tools such as GitHub. Once you sign up you can create CodePens that you then fill in with your code. You can then share the codepen by sharing the link, as an example here’s one of my codepens: https://codepen.io/BenTechCode/pen/KKzWvWE
I have 5 .html files called
omega.html
bulova.html
timex.html
casio.html
rolex.html
they are contained in nested folders as shown
WILL STERN
omega.html
FANCY
bulova.html
timex.html
CONTRAST
casio.html
ULTIMATE
rolex.html
every .html file has links as shown -
the links function well except in the 2 following circumstances
on the casio.html page - the rolex link doesn’t work <li><a href="ultimate/rolex.html">rolex</a></li>
I thought that I had to point to the folder that rolex was in - ULTIMATE - to make the link work
on the rolex.html page - the casio link doesn’t work <li><a href="contrast/casio.html">casio</a></li>
I thought that I had to point to the folder that casio was in - CONTRAST - to make the link work
It’s not a case of going up in the hierarchy so I don’t think I would use …/ here and so by default I used the folder that the anchor was in for href but it’s not working. What is the correct approach here?
Actually - that works perfectly - it’s just that I don’t get the reasoning behind it. I thought that the folders
Contrast and Ultimate were at the same level within the Fancy folder. Furthermore, I thought that the pointers could only be
…/…/
or
Fancy/Contrast/
but not a combination of the two. Obviously I am wrong but I just don’t get the combination approach.
So I have been thinking about this issue of the href pointer. So if we have the following hierarchy where one folder contains - one page + 3 folders each with one page like this (to sort of carry on with the previous nomenclature)
WILL STERN
omega.html
FANCY
bulova.html
CONTRAST
timex.html
ULTIMATE
casio.html
then, if we have the link “omega” in any of the 3 bottom folders, then we will have an href=../
However, if we have a link from one of the 3 bottom folders to a page also in one of the 3 bottom folders, then we have (if we are on the timex.html page and want to get to the bulova.html page) an href=../FANCY
Is this the right line of reasoning?