Help - Search - Members - Calendar
Full Version: How Do I Send A Link To A Webpage Deep In The Page
BleepingComputer.com > Internet & Networking > Web Site Development
   
Martel
I am wondering how to set a hyperlink that will take the reader to a pre destined place on a web page.

Like down on page three or maybe page fourty seven of a web page.

Am I making sense here?


For example if I wanted somebody to find the term Command Line Editing
It is located at the bottom of this web page.


Mod Edit: Topic moved to more appropriate forum~ TMacK
Wysi Free
Yes. You are making sense and that is a good thing to do -- link to a precise place in a page.

I haven't done that yet but here are some links that will show you the way.
http://www.w3schools.com/html/html_links.asp
http://www.w3.org/TR/html401/struct/links.html
http://www.echoecho.com/htmllinks08.htm

It is one of those things on my list of things to learn. I haven't learned it yet but one day I want to send people to a specific term or place on the page. That would be an anchor.

Wysi
cool.gif
Martel
Those are informative HTML tutorials
I am still missing something...

I understand the wording and linking but the anchoring is fuzzy

say you wanted to link to

Table 8-1
Operating System Commands
located at
http://www.drdos.com/dosdoc/usergeng/08ugch8.htm
<A><Table Border="3">
<caption><a name="530">
Table 8-1 <br>Operating System Commands<p>
</a>

I am either missing the big picture or the little picture.

Also, it is what you do when you have a long page with a table of contents and you link the contents to places in the document.

EDITED because my brain is about two minutes time delayed with my hands typing
Noot
If you are asking whether or not you can link to an anchor on another page, you can. You just have to make sure all anchors are set up and you're linking to them correctly.

But to answer your question, yes, it is often used to in essence break up a very long page in certain sections to help viewers find the information they want quicker, without having to search the whole page for one certain section.

Now, to your anchors are fuzzy, what do you mean? I've used them often in some times I've done, so I can help explain it to you better if necessary. smile.gif

Amazing Andrew
Quick and Dirty Tutorial on Anchors:


HTML
<a name="section1"></a>

Placing the above code at the beginning of section 1 of your document will create an anchor to that exact spot.

HTML
<a href="#section1">Go To Section 1</a>

This code points to the anchor you just made. Notice the # symbol, that's a must.

So, let's say you wanted to create a table of contents for your page. You would do something like this:


HTML
Table of Contents:
<a href="#section1">Section 1</a>
<a href="#section2">Section 2</a>
<a href="#section3">Section 3</a>

<a name="section1"></a>Welcome To Section 1!
...
...
...
<a name="section2"></a>Welcome To Section 2!
...
...
...
<a name="section3"></a>Welcome To Section 3!


It's really easy once you nail it down.
Amazing Andrew
Also, for the specific page/section you mentioned in you post, the hyperlink to it would be: http://www.drdos.com/dosdoc/usergeng/08ugch8.htm#279

Note how the #279 is added to the end of the regular address.
Martel
That is Amazing Andrew.

How did you know to use the 279

Oh wait
</a><a name="279">
<h3> Extended Command Line Editing</h3>
Amazing Andrew
Exactly!

Here's a little trick to find the anchors in a page:

Create a new bookmark in your browser.
Paste this into the bookmark's location field (the URL part):

CODE
java script:(function(){var atags,i,name,a; anchs = document.anchors; for(i=0; i<anchs.length; ++i) { a = anchs[i]; name = a.name; a.appendChild(document.createTextNode(%22#%22 + name)); a.style.border = %221px solid%22; a.href = %22#%22 + name; } })();


Note: Remove the space between "java" and "script" in the above code. The forum software adds it for security purposes. Also, the code should all be on one line, but it wraps around here.

Now save the bookmark.

Now you can use that bookmark on any page and it will turn all the anchors on the page into visible links!
Martel
Thank you for the information.

Sorry it took so long for me to get back here.

I have been struggling with a hard drive trying to rescue files, ..to no avail. (arrg)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.