Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 195
  • Last Modified:

HTML hyperlinks not working

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
dgmoore1
Asked:
dgmoore1
  • 4
  • 2
  • 2
1 Solution
 
Scott Fell, EE MVEDeveloperCommented:
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
 
dgmoore1Author Commented:
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
 
dgmoore1Author Commented:
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Chris StanyonCommented:
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
 
Scott Fell, EE MVEDeveloperCommented:
If it still does not work, just post a link to your sample page.
0
 
dgmoore1Author Commented:
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
 
Chris StanyonCommented:
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
 
dgmoore1Author Commented:
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now