0

I feel like this should be very basic, I've been searching but can't seem to word it well enough for searches.

currently I have 2 html pages, my first index.html page has a navigation that links to itself throughout the entire site.

Home Services Portfolio Contact

all of these section are on the main page (one page layout)

now I have recently added a secondary html page that is accessed via a button in the portfolio section to see a gallery of photos, easily enough I can get to that page via href="portfolio.html" equally if i want to get back to my home page I can put in href="index.html"

here comes my troubles... What if I want to not only get to the home page, but I want to get to the Services section that is on the home page?

href="index.html/#services" throws error.

Thank you for your time.

Carl
  • 307
  • 3
  • 11
  • This is hard to answer with no code examples, are you sure you have setup the anchors correctly? http://stackoverflow.com/questions/484719/html-anchors-with-name-or-id – Ray Koren Jan 24 '17 at 23:12

2 Answers2

0

well...you're doing well to get into a specific place in the page you need you define id to your element and pass it with the URL. it'll be much easier to see the code itself and tell you what's wrong. try to check that the element has the right id or that you don't call different elements with the same id so the browser can't decide which element you'd like to go to

Chen Zissu
  • 73
  • 1
  • 10
0

Link should be: <a href="index.html#services">Services</a>

anchor should be: <a id="services"> ... </a> (HTML5)

  • I was putting a "/" between elements. such as: href="index.html/#services" vs. Services as simple as that.. thank you so much, and thank you to all who were willing to add comments and support my question... your footprint makes a difference to me at the very least! – Carl Feb 01 '17 at 03:26
  • I had the same problem, but the index.html#services goes back only to index.html and not to the section that has the id services, do you have any idea why is this happening ? – Elroum Apr 21 '18 at 20:01