Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

Navigating to a specific section of a different page.

How can I navigate to a specific section of a different web page I am creating? For example, in a video, Guil teaches us how to navigate to a specific point of the SAME page we are creating by assigning an ID attribute for the section we want to navigate and then, targeting the ID values within the HREF attribute. Now, I want to know how to target specific sections of a different page in a way that when I click on a link in certain PAGE A I could be directed to, for example, the bottom of a PAGE B.

Hope that someone can understand what I want to do. I swear it makes sense in my mind! (lol)

Thanks in advance!

1 Answer

With a little bit more of research I could find the answer. We need to take the same steps we did to navigate to a specific section of a "PAGE A": 1) In the PAGE B, we set an ID for attribute for the section we want to navigate; 2) In the PAGE A, we set the path to the pageb.html as avalue of HREF attribute and then link the ID of the section in PAGE B at the end of the HTML path using the # sign. It will look like this:

<a href="\users\desktop\pageb.html#anyIDofPAGEB">Section we want to navigate</a>