Author Topic: How to Link to the middle of a page  (Read 1729 times)

Offline kitep

  • DnD Handbook Writer
  • ****
  • Posts: 1948
  • Lookout World!
    • View Profile
How to Link to the middle of a page
« on: April 27, 2012, 03:14:38 PM »
I wanted to link someone to Ring of Friend Shield  But I only know how to make it point to the page.  How do I make it so this particular ring appears near the top of the screen?

Offline Garryl

  • DnD Handbook Writer
  • ****
  • Posts: 4515
    • View Profile
Re: How to Link to the middle of a page
« Reply #1 on: April 27, 2012, 03:22:57 PM »
http://www.d20srd.org/srd/magicItems/rings.htm#friendShield

It's an HTML thing, where you add #name to the end of a link (where name is the name of the HTML element) and it will jump to that element's location on the page. If you're using Firefox, you can play around with the element inspector (right-click, then click on "Inspect Element (Q)") to see if there are any named elements near what you're looking for.

Offline kitep

  • DnD Handbook Writer
  • ****
  • Posts: 1948
  • Lookout World!
    • View Profile
Re: How to Link to the middle of a page
« Reply #2 on: April 27, 2012, 04:29:52 PM »
Let me try it out.

Ring of Friend Shield

Cool - it works.  Mostly.  It puts it at the top of the page, where a header than covers it up.  Is there a way to make a appear a few lines down from the top?

And how do you know the magic word is "friendShield"?  Do I have to look at the html code to figure it out?

Respect given for a helpful answer.  Now you're up to 19.  :)



« Last Edit: April 27, 2012, 04:38:47 PM by kitep »

Offline Garryl

  • DnD Handbook Writer
  • ****
  • Posts: 4515
    • View Profile
Re: How to Link to the middle of a page
« Reply #3 on: April 27, 2012, 09:28:12 PM »
Whether it's at the top just below the header or hidden beneath it depends on what browser is being used. If you want to be certain it's visible and near the top, I'd suggest setting the link's jump point (I wish I knew what the correct term is for that) to whatever item is immediately above it in the list.

Yes, you do unfortunately have to inspect the HTML code. The contents of that code is what the browser uses to decide where to jump to when the page loads. As I mentioned before, Firefox has tools to easily inspect such things, as do some other browsers. You can get it with any browser if you just look at the source code directly (try searching for the text on the page around the place you're looking for to help you find the right place in the HTML maze). Just make sure you use the NAME field of the HTML element.

Thanks for the ++'s. Glad I could help.

Offline kitep

  • DnD Handbook Writer
  • ****
  • Posts: 1948
  • Lookout World!
    • View Profile
Re: How to Link to the middle of a page
« Reply #4 on: April 27, 2012, 09:37:25 PM »
Thanks.  Not quite as easy as I was hoping for, but now I know.