The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Internal links not working
Leezinho
post Feb 21 2019, 11:58 AM
Post #1


Newbie
*

Group: Members
Posts: 11
Joined: 21-February 19
Member No.: 26,828



I have some links internal to the document, in a Table Of Contents at the top. When I click on one of the highlighted section titles, it should go to that section in the same document. I have tried three solutions, but none of them work. My anchors in the body of the document are named with a short form of the section title, with no "#" at front.

(I'm converting the HTML document to PDF. In the PDF document, _external_ links work okay.)

(1) <a href="#secTitle">Section Title in TOC</a>
TOC gives a little jump.

(2) <a href="fileName.pdf#sectTitle">Section Title in TOC</a>
Nothing.

(3) <a href="files/theme/fileName.pdf#sectionTitle">Section Title in TOC</a>
The webhost (Weebly) gives me a light blue screen with "Bye!" on it.

When I open the box for "Link Properties" of the TOC item, the ballot box for "URL is relative to page location" is already checked. That looks correct; when I uncheck it, the address refers to a file on my computer ("file:///c:/..."), which I don't want when I upload.

Suggestions?

This post has been edited by Leezinho: Feb 21 2019, 12:00 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 21 2019, 02:27 PM
Post #2


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,310
Joined: 9-August 06
Member No.: 6



QUOTE(Leezinho @ Feb 21 2019, 05:58 PM) *

My anchors in the body of the document are named with a short form of the section title, with no "#" at front.


So how does that look?

Please post an actual link with the real name you use instead of "secTitle" and also the markup for the corresponding target.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Feb 21 2019, 02:37 PM
Post #3


.
********

Group: WDG Moderators
Posts: 8,178
Joined: 10-August 06
Member No.: 7



QUOTE(Leezinho @ Feb 21 2019, 05:58 PM) *

(1) <a href="#secTitle">Section Title in TOC</a>
TOC gives a little jump.

The above link looks correct, but if the distance to the targetted element or the bottom of the page is small, then all you'll get is a small jump.

QUOTE
(2) <a href="fileName.pdf#sectTitle">Section Title in TOC</a>
Nothing.

I don't know how PDF files work, so no idea if the above is possible even in browsers that display PDF files.

QUOTE
(3) <a href="files/theme/fileName.pdf#sectionTitle">Section Title in TOC</a>
The webhost (Weebly) gives me a light blue screen with "Bye!" on it.

Don't know what that Weebly message is supposed to mean, but is the URL "files/theme/fileName.pdf" valid in the first place?

User is online!PM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 21 2019, 03:58 PM
Post #4


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,310
Joined: 9-August 06
Member No.: 6



I didn't see that one link leads to a PDF. It's supposed to work. Haven't tried in many a year, but I never got it to work when I did.
https://helpx.adobe.com/acrobat/kb/link-htm...ge-acrobat.html

Didn't see the bit about the little jump either. blush.gif Good Christian caught it.

I don't find a good example now, but if you go for instance here http://htmlhelp.com/tools/widgets/#license , you can see that the License topic doesn't scroll to the top because there isn't enough page left for it to do that. For that reason it will under most circumstances look the same as http://htmlhelp.com/tools/widgets/#issues and http://htmlhelp.com/tools/widgets/#acknowledgements .

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Leezinho
post Feb 21 2019, 04:09 PM
Post #5


Newbie
*

Group: Members
Posts: 11
Joined: 21-February 19
Member No.: 26,828



Okay, pandy (#2), here's the link in the Table Of Contents:

<a href="#form">
<big><big><span style="font-weight: bold;">
2. Variations of form.</span>
</big></big></a>

"#form"—to say the target is "form"—is the reduced version of the section title
"2. Variations of form." Seems to me this should be enough, and the name of the document—
"quesera2.html" while I edit it, "quesera.pdf" after I convert it—
should be taken for granted by default.
But still I've tried it with "quesera.pdf/#form" just in case there could be any doubt.*
I use ".pdf" instead of ".html" because that's what it will need on the site.

And here's the designation of the target at the beginning of the section "2. Variations of form." itself:

<span style="font-weight: bold;">
<a name="form"></a>
2. Variations of form.
</span>

* And Weebly seems to need "files/theme/" before a filename, so I've tried that too, with no result.

I will follow your links (#4) and see what they offer.
Thx
-----------------------
Oops! I've just looked at the HTML version of "quesera.html" _offline_, and the internal links work perfectly.
But _online_ those internal links—in the HTML version—don't work.

This post has been edited by Leezinho: Feb 21 2019, 04:50 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 21 2019, 04:49 PM
Post #6


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,310
Joined: 9-August 06
Member No.: 6



Looks alright. There are better ways of doing it, but I guess you don't edit manually and this should work.

So, is the target just under the link or close to the bottom of the page?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Leezinho
post Feb 21 2019, 05:47 PM
Post #7


Newbie
*

Group: Members
Posts: 11
Joined: 21-February 19
Member No.: 26,828



I do edit HTML code directly, but with great care and trepidation.
The 23 targets are distributed throughout the document, at all distances from the TOC.
The small jump is an insignificant jitter: the text jumps up a line and back to its original position, if I remember correctly.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 21 2019, 06:39 PM
Post #8


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,310
Joined: 9-August 06
Member No.: 6



Well, then I don't think we can help without seeing the whole thing. Do you have it on the web?

If you want to edit it, you don't need an A tag for the target at all, and especially not an empty one. You can use id as well as name (in fact you should, name is antiquated). And you can add an id attribute to any tag.

So you could do it like this.
HTML
<span style="font-weight: bold; id="form">
2. Variations of form.
</span>


The span isn't needed either, really. The heading should be in some kind of container, let's say a H3. Then you do it like this.

HTML
<h3 id="form" style="font-weight: bold">2. Variations of form.</h3>


Optimally the style attribute should also go and the CSS should be put in a separate style sheet instead.

But the markup is probably full of things like this, so I wouldn't bother. It should work as it is. Just wanted to explain what I meant before.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Leezinho
post Apr 18 2019, 06:39 AM
Post #9


Newbie
*

Group: Members
Posts: 11
Joined: 21-February 19
Member No.: 26,828



The problem got solved several weeks ago. Sorry, I don't remember how.
Thanks for your input.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 18th July 2019 - 10:40 AM