Login | Register | FAQ
Anonymous

Why isn't the internal link working?

+ Post a reply

4 posts Page 1 of 1


Why isn't the internal link working?

by jefals » Fri Nov 26, 2010 3:48 am

<html>
I've tried this several different ways, using the NAME attribute rather than ID,
also using both NAME and ID ... just can get it to jump to the line that says "id=heading1"... Can you help?
Thanks!
Jeff
<head>
</head>

<body>

<p><a href="#heading1">Link to heading 1</a></p>
<p><a href="#heading2">Link to heading 2</a></p>
<h1 id="heading1">heading</h1>
<p>Text text text text</p>

<h1 id="heading2">heading 2</h1>
<p>Text text text text</p>

</body>

</html>
User avatar

jefals

  • Posts: 3
  • Joined: Fri Nov 26, 2010 3:43 am

Re: Why isn't the internal link working?

by HTML.net » Fri Nov 26, 2010 11:16 am

Hi Jeff,

The code is correct. But it might be because the page so short you don't expirence the "jump". Try to make the page longer and I am sure it will work fine:

<p><a href="#heading1">Link to heading 1</a></p>
<p><a href="#heading2">Link to heading 2</a></p>

<div style="height:1000px;"></div>

<h1 id="heading1">heading</h1>
<p>Text text text text</p>

<h1 id="heading2">heading 2</h1>
<p>Text text text text</p>

- Andreas, HTML.net
User avatar

HTML.net
Site Admin

  • Posts: 1194
  • Joined: Sat Sep 11, 2010 11:24 am
--
Show some love for HTML.net on Twitter, Facebook and Google: Use the buttons on top of all pages.

Re: Why isn't the internal link working?

by jefals » Fri Nov 26, 2010 2:29 pm

Thanks Andreas ,

Still isn't working the way I'd expect. That DID make it jump -- however, it seems to have jumped to a spot about 5 inches above the word "HEADING". In other words, it jumps -, but now HEADING is close to the bottom of the browser, preceeded by 4 or 5 inches of white space..
User avatar

jefals

  • Posts: 3
  • Joined: Fri Nov 26, 2010 3:43 am

Re: Why isn't the internal link working?

by jefals » Fri Nov 26, 2010 11:33 pm

ok, got it. That <div style> element added space between the link and the "heading", but there was still not much at the end. I added more stuff after the "heading2" at the end, and now I see it doing what it's s'posed to! (Sorry -- you can probably tell I'm new at this! :)
User avatar

jefals

  • Posts: 3
  • Joined: Fri Nov 26, 2010 3:43 am


+ Post a reply

Page 1 of 1