Help needed adding links to different parts of web page

Hi , I am trying to add links to different sections of my web page . I have tried the a href link with an id but it doesn’t seem to be linking. Any help would be appreciated. Thanks.


If you are referring to creating an anchor to other elements on the same page the following is an example of how to create a link to, say, a contact form on the same page:

<!-- Anchor -->
Don't hesitate to <a href="#contact-me">get in touch</a> with me if you would like to talk about a fun project or hiring me!

<!-- Contac Form -->
<h1 id="contact-me">Contact Me</h1>
    <!-- Form -->

The key is to refer to the id of the element that you would like to “hop” to. :slight_smile: I hope that helps!

EDIT: It’s worth noting that it also works with an external link, too. For example:

<a href="">How it Works</a>

HI , I have tried that but it does not seem to link when I try that from the navigation to the different sections. It just seems to refresh the page.

If you are referring to the links in your main navigation, I have some suggestions for you.

  1. Right after href you need to have the equal symbol (=). without the ( ) brackets.

  2. For portfolio your taget is #middle, but I do not see a div or paragraph with an id of #middle. Try adding #id=“middle” after class=“text-center”.
    <p class="text-center id="middle">Portfolio</p>

  3. Do the same thing for the paragraph Contact
    <p class="text-center id="contact">Contact</p>

  4. You will need to remove the hash tag symbol (#) and replace it with the word contact.

Check out this page at W3schools.

Hi there thanks for the reply. I have tried that . Could it be that I need to make the page scrollable ? Thanks.

I mistakenly told you to remove the hash tag. Sorry.
Your links should look like Haiiiiyo showed.

<li><a href="#middle">Portfolio</a></li>

Thanks very much that worked! I will now attempt to make them scrolleable. Cheers.