skip to Main Content

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


  1. in section link write this code

    Login or Signup to reply.
  2. To create a "back" link that takes the user to a specific section of your index.html page, you can use HTML anchors and the href attribute. Here’s how you can achieve this:

    1. Assign an ID to the target section: In your 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:
    <section id="portfolio">
      <!-- Content of the portfolio section -->
    </section>
    
    1. Create a "back" link: In the section where you want to create the link that takes the user back to the portfolio section, add an anchor tag (<a>) with the href attribute set to #portfolio. For example:
    <a href="#portfolio">Back to Portfolio</a>
    
    1. Testing: Save your 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.

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