0

I've started html basics and I'm trying to do simple nav menu with 3 sites like this (index on the bottom is main page and these in "podstrona" folders are subpages):

enter image description here

My code looks just like this:

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style/style.css" />
<meta charset="UTF-8">
<title>Podstrony</title>
</head>
<body>

<ul id="menu_lista">  
 <li><a href="index.html">Strona Główna</a></li>  
 <li><a href="/podstrona1/index.html">Podstrona nr 1</a></li>  
 <li><a href="/podstrony/podstrona2/index.html">Podstrona nr 2</a></li> 
</ul>  


</body>
</html>

I tried different paths as you can see but no one can bring me to any subpage. What should I type to get to them? I searched in web but I didn't find anything helpful with this.

Federico klez Culloca
  • 26,308
  • 17
  • 56
  • 95
justme
  • 13
  • 2

1 Answers1

0

You're in podstrony, remove the first slash of the 1st link, and the /podstrony/ from the 2d.

When you leave the slash, it means your page will search at the root directory of your server. Without it, the path is relative to the current file path.

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style/style.css" />
<meta charset="UTF-8">
<title>Podstrony</title>
</head>
<body>

<ul id="menu_lista">  
    <li><a href="index.html">Strona Główna</a></li>  
    <li><a href="podstrona1/index.html">Podstrona nr 1</a></li>  
    <li><a href="podstrona2/index.html">Podstrona nr 2</a></li> 
</ul>  


</body>
</html>
Veve
  • 6,643
  • 5
  • 39
  • 58