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,
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
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,
2
Answers
in section link write this code
To create a "back" link that takes the user to a specific section of your
index.html
page, you can use HTML anchors and thehref
attribute. Here’s how you can achieve this:index.html
file, locate the section you want to link to (in this case, the portfolio section) and assign it a unique ID. For example:<a>
) with thehref
attribute set to#portfolio
. For example:index.html
file and open it in a web browser. Clicking on the "Back to Portfolio" link should now scroll the page to the portfolio section.Make sure that the IDs you assign to sections are unique and match the target section ID in the
href
attribute of the link. Also, ensure that the link is placed in the appropriate location in your HTML structure.