Jump to content
Stef's Coding Community

Ch4 L8 web directory paths


Recommended Posts

Everything worked out just fine for me as per the video's objectives.

However, I would like to know why,when I am here:     root/sub-pages/my-friends.html

and I click 'my plans' or 'my work', it doesn't work.

The directory path for these is within subpages folder, but when I look in subpages they are not there but rather in root dir.

Q: How do we click my plans and my work from within root/sub-pages/my-friends.html

and get them to work? Within Sublime my-friend.html  tab I tried coding:   ../my-website/my-plans.html      but to no avail.

 

<!doctype html>
<html>
     <head>
          <title>Friends page</title>
     </head>
<body>
	<p>Welcome to my personal <a href="../sub-pages/index.html"> home page.</a></p>
	<hr>
	<h1> Friends Page</h1>
	<p>Check out a list of <a href="my-friends.html">my friends.</a></p>
	<p>Check out a list of <a href="../my-website/my-plans.html">my plans.</a></p>
	<p>Check out a list of <a href="../my-website/my-work.html">my works.</a></p>
	</body>
</html>
Edited by webmanz
Link to post
Share on other sites

I don't really get your folder structure but I suggest somesting like this:

ROOT
  index.html
SUBPAGES
  my-friends.html
  my-plans.html
  my-work.html

Then your my-friends.html should look like this:

<!doctype html>
<html>
     <head>
          <title>Friends page</title>
     </head>
<body>
	<p>Welcome to my personal <a href="../index.html"> home page.</a></p>
	<hr>
	<h1> Friends Page</h1>
	<p>Check out a list of <a href="">my friends.</a></p>
	<p>Check out a list of <a href="my-plans.html">my plans.</a></p>
	<p>Check out a list of <a href="my-work.html">my works.</a></p>
	</body>
</html>

And your index.html like this:

 

<!doctype html>
<html>
     <head>
          <title>Friends page</title>
     </head>
<body>
	<p>Welcome to my personal <a href="#"> home page.</a></p>
	<hr>
	<h1> Friends Page</h1>
	<p>Check out a list of <a href="subpages/my-friends.html">my friends.</a></p>
	<p>Check out a list of <a href="subpages/my-plans.html">my plans.</a></p>
	<p>Check out a list of <a href="subpages/my-work.html">my works.</a></p>
	</body>
</html>

 

 

Edited by Bake76
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...