Solved

HTML hyperlinks not working

Posted on 2013-11-24
8
182 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
8 Comments
 
LVL 53

Expert Comment

by:Scott Fell, EE MVE
ID: 39672828
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
ID: 39672893
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
ID: 39672900
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 43

Accepted Solution

by:
Chris Stanyon earned 500 total points
ID: 39672913
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
 
LVL 53

Expert Comment

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

Author Closing Comment

by:dgmoore1
ID: 39673037
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 43

Expert Comment

by:Chris Stanyon
ID: 39673057
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
ID: 39673244
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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Sending ASP to server side 8 42
links not working 2 32
Two decimal 5 41
Check input text, Number 7 54
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

738 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