Linking to a specific section of another page is NOT working (HTML)

Hello every one, here is my problem: I want to create a “back” link to the Specific section of my index.html when the user click on a project.

On my index.html I have all my sections and I have named each section with an ID. On the homepage

It doesn’t work: it returns to the homepage instead of the portfolio section… I would appreciate some help and advice because I am stuck at this point
Thank you in advance,

Welcome to our community!

If you have any question about code, please post it here.

1 Like

On my index.html I have named each section with an ID. On the homepage for E.G

<section id="portfolio " class="mt-3" >

On the Other page I create a “back” link to the portfolio section of my index.html

<a class="nav-link" href="../#portfolio ">
                    <span>portfolio </span></a>
            </li>

It doesn’t work: it returns to the homepage instead of the portfolio section…

It work fine on the same page but not work other pages

If I have understood well, you want to link one page to the other. For example ‘portfolio.html’ to 'index.html. You cannot link back to the section element of any page (in your case, index.html). Only to the index.html from portfolio.html, and then, you should click on the link to a particular section. However, if you want to link to your portfolio page from each new html page, you should create a page dedicated to your projects, and create a link to it from any other page, including even index.html. You may want to create a page for each project separately. In that case, you can link to a particular project from any page you have in the website structure.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.