Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Copy path in CodeAcademy

I am a beginner at HTML I am trying to put one of my projects on to a workspace on CodeAcademy.

I however have multiple html files that I have uploaded.

The intended code should work such that if I press the "whatever" button, it takes me to that page using directory of that file.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I have gotten this to work locally on my personal laptop because I know the directory (ex: C:/user)

Now that I have uploaded it to the CodeAcademy workspace, I do not know hot to get a certain files source.

Any help would be appreciated. (I am assuming only someone who has used CodeAcademy workspace might be familiar with this)

>Solution :

Use relative path instead…

Let’s say your project structure is like this:

pages/about.html
services.html
index.html

In index.html:

<a href="./index.html">Home</a>
<a href="./services.html">Services</a>
<a href="./pages/about.html">About</a>

In services.html:

<a href="./index.html">Home</a>
<a href="./services.html">Services</a>
<a href="./pages/about.html">About</a>

In pages/about.html:

<a href="../index.html">Home</a>
<a href="../services.html">Services</a>
<a href="./about.html">About</a>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading