Internal Links

pic internal Link

If you want to go from one part of a page to another part of the same page then you need an internal link. The way I do it here is preferable to the way the book does it since you aren't dumping unecessary anchors all over the place. There are two parts/steps to an internal link, not just one as with External Links:

  1. Give the destination element (often a heading, but this could be pretty much anything) an id attribute with a short descriptive name.
  2. Give the source anchor an href attribute with the value of #, followed by the id you chose above.
One hitch you may encounter is is when the page you're jumping around on fits entirely on the window or if the destination is close to the bottom. The page will not jump to where you might have thought it would; the browser won't create extra page just for a jump. Make your page bigger to test if you're unsure (a bunch of breaks at the end will do the trick). In a pinch you can sometimes (if there's a lot of text on the page) resize the window to make it very narrow so you can see the jumping.

Links:
Back to Knowledge Dump