skip to Main Content

My anchor tag on github pages is not working it leads me to 8bitbug.com but i cant change anything in the settings or i cant find anything to change that the anchor tag does lead to the index file

<a class="Introduction" href="/index.html">Introduction</a>

The parent element is

<div class="Introduction">

The problem seems to be only on github since on vercel the anchor tag works completely fine

I tried to change the class the parent element

2

Answers


  1. You should add " . " to begining of your href like;

    <a class="Introduction" href="./index.html">
    

    It will work if the index.html file is in the same folder.

    If you want to move up to parent directories you can use " ../ " for every directory.

    <a class="Introduction" href="../index.html">
    
    Login or Signup to reply.
  2. Assuming that your anchor tag is in root directory you can modify it like this:-

    <a class="Introduction" href="index.html">Introduction</a>
    

    If the same issue occurs again then you should check your GitHub Pages settings for the correct base URL.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search