Jin
Jin

Reputation: 87

Linking to another html page on Github

I've tried to search for a solution to this but wasn't quite sure how to phrase my problem in google in a concise way to obtain a solution.

I'm rather new to Html and git hub and recently I made my own Github page with my own html code.

In short, I have an file: index.html in github which is the main page. I would like it so that when I press the "About Me" button, it will open aboutme.html as a page(also in the same github repository).

My attempt at this problem is by using onclick followed by the html file name like so:

<div class="box2" onclick="aboutme.html'"> About Me</div>

(box2 is the button class I use)

which normally works for regular links. however clicking on the button when the html file in put in instead doesn't do anything.

Thank you so much for any input regarding the matter!

If needed here is the site I've been working on: http://stevezease.github.io/ I'm always open to constructive criticism and suggestions!

Upvotes: 5

Views: 23075

Answers (2)

Leandro Meili
Leandro Meili

Reputation: 131

Your should use absolute paths: https://<user.name>.github.io/<repo.name>/

If your index and about.html is under the root folder then you should type:

<a href="https://<user.name>.github.io/<repo.name>/about.html" title="About Me">About Me</a>

For navigating folders like /css or /js, make sure the folder is under the root.

Example link would be:
https://<user.name>.github.io/<repo.name>/css/style.css

Upvotes: 4

Gabriel Sadaka
Gabriel Sadaka

Reputation: 1746

What you need is a html anchor link, please see this page for details about it: http://www.w3schools.com/html/html_links.asp

Use this code to link to your about me page:

<a href="about.html" title="About Me">About Me</a>

Upvotes: 6

Related Questions