Skip to content
Discussion options

You must be logged in to vote

<a href="html/second.html"> creates a relative link to second.html within a directory called html. If you have the files right next to each other there won't be such a directory, and you don't need it.

A relative link (one not starting with a URL scheme like https://, or a slash /) means always to start looking in the same directory as the file in which the link is. So if the files index.html and second.html are in the same directory, this will work:

<a href="second.html">link text</a>

See also: What is a URL?, in particular the Absolute URLs vs relative URLs section.

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@ellefon
Comment options

@zanaart
Comment options

Answer selected by queenofcorgis
Comment options

You must be logged in to vote
1 reply
@ellefon
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pages Host a static website, right from your repo New To GitHub 👋 New To GitHub
5 participants