Solved

HTML hyperlinks not working

Posted on 2013-11-24
8
174 Views
Last Modified: 2013-11-24
I have a simple html file with a large number of links that work correctly and two that do not (there is no response when the links are clicked - this is not a "Page not found" error). All of the referenced pages are in the same folder as the problem html file.

When I paste the two non-working links into a new html document they work fine, so evidently there is something in the problem html page preventing them from working.

I have attached a copy of the problem html file. The 25 links in the javascript dropdown work correctly; the two links on line 27 ("Portfolio View" and "High Level/QPR View") are the ones that do not.

The problem is probably obvious and I have missed it while staring at it too long. Any assistance would be appreciated - thanks.
indextest.htm
0
Comment
Question by:dgmoore1
  • 4
  • 2
  • 2
8 Comments
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
Comment Utility
Right now your code renders like below.  The tag font face is not valid and why the empty p tag?

<td>
   <font face="Arial, Helvetica">
      <a href="portfolio_view.htm">Portfolio View</a>
      <br>
       <a href="hpt_high_level_view.htm">High Level/QPR View</a>
    </font>
   <p></p>
</td>

Open in new window

Try changing your code where you get rid fo the font tag, and instead use a class on the td or directly in the a tag.  Then use css to control the font.
<td class="something">
      <a href="portfolio_view.htm">Portfolio View</a>
      <br>
       <a href="hpt_high_level_view.htm">High Level/QPR View</a>

</td>

Open in new window

0
 

Author Comment

by:dgmoore1
Comment Utility
I'll give that a shot - this is just a mockup page and I wanted to get the basics right before working on the css.

Thanks
0
 

Author Comment

by:dgmoore1
Comment Utility
OK - I tried your suggestion and substituted
<tr>
      <td class="fontstyle"><a href="portfolio_view.htm">PADD Portfolio View</a>
      <br>
      <a href="hpt_high_level_view.htm">High Level/QPR View</a></font><p></td>
    </tr>

Open in new window

but the link behavior does not change.
0
 
LVL 42

Accepted Solution

by:
Chris Stanyon earned 500 total points
Comment Utility
You have an invalid DOCTYPE which throws you into Quirks mode - not a good thing. This is 2013, so go with an HTML5 DOCTYPE:

<!DOCTYPE html>

Having said that, I can't see a problem. The links on your page seem to work fine (obviously they don't go to the right page because they're relative links)

FYI - the code still has a closing </font> tag and a stray <p> tag for absolutely no reason. Also <font> and <center> are depreacted - drop them from your document completely.
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
Comment Utility
If it still does not work, just post a link to your sample page.
0
 

Author Closing Comment

by:dgmoore1
Comment Utility
This is on my company intranet and contains proprietary info, so I can't post a link. I did find the problem, however: the line

<!-- saved from url=(0016)http://localhost -->

which I grabbed from an old page (it was originally used to suppress the browser warning about ActiveX content, but must have been superseded in recent years) was causing the problem. I deleted the line and, voila, everything works.

I'm giving you full points because your suggestions are all helpful, even though they did not address the direct cause of the problem. Live and learn - I gotta clean up some of this stuff!

Thanks
0
 
LVL 42

Expert Comment

by:Chris Stanyon
Comment Utility
The line you deleted is just a comment. I doudt removing a comment will fix anything.

You still have an invalid doctype and lots of deprecated tags.

Run your site through a Validator
0
 

Author Comment

by:dgmoore1
Comment Utility
True - it is just a comment. But the links don't work with it there and they do work with it gone. After I verified this - and I find it hard to understand also, but it is what it is - I cleaned up the rest of the html and ran it through the W3 School's validator and it's all clean now. But if I add that <!-- comment line back in, the links stop working again. Go figure.

Thanks for your comments.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now