Anchor tags not redirecting in HTML page!

February 15, 2011 at 21:49:44
Specs: Windows Vista
I have a few anchor tags (like ) nested inside <ul> and <li> tags on an HTML application. But some of these anchor tags does not work, though in the status bar the exact url is shown. Why would'nt the anchor tags work?

See More: Anchor tags not redirecting in HTML page!

Report •

February 15, 2011 at 23:45:54
Please provide some code nested in <pre > tags to illustrate how you're using the tags.

Apologies if I don't respond to your reply immediately. I don't check this site daily.

Report •

February 15, 2011 at 23:57:02
Here is a code snippet from my Home.htm page:

<LI><A... href="../abc/xyz1.htm">abc1</LI>
<LI><A ....href="../abc/xyz2.htm">abc2</LI>
<LI><A ...href="../abc/xyz3.htm">abc</LI>
<LI><A... href="../abc/xyz4.htm">abc</LI>

Report •

February 16, 2011 at 01:19:04
nebody who knows a solution?????????

Report •

Related Solutions

February 16, 2011 at 03:47:43
Try closing the anchor tags after the anchor text and removing the ... after the <A.


Report •

February 16, 2011 at 04:07:26
that was typo error..

here is the actual code:
<ul id="treemenu1">
<li><a ... href="index.htm">Home</li>
<li><a ... href="../BusinessGroups/index.htm">Business --- > not working
<li><a ... href="../BusinessGroups/index.htm">Prodcuts --- > not working
<li><a ... href="../businessgroups/services.htm">Services --- > not working
<li ><a ... href="../customers/customers.htm">Customers</li>
<li><a ... href="../Contact/Contact.htm">Contact</li> --- > not working

btw, these are local links and also it works in FF but not in IE. Wat can be the issue with IE then?

Report •

February 16, 2011 at 13:16:55
1.) You haven't closed any of the anchor tags:
<li><a ... href="index.htm">Home</a></li>

2.) Each of your anchor elements has an ellipse. Is that intentionally an ellipse, or just to tell us you omitted some attributes to the element? If you're looking for help with syntax, it's usually not a good idea to omit sections of the problem code.

3.) I don't know the hierarchy of your folders, but you should try using absolute links instead of relative links. The ../ signifies one folder up from where you presently are.

4.) You should keep all files and folders lowercase, or at least keep the same style across your website. You have some mixed case and some lowercase. Lower case is preferred universally among web languages.

5.) One of your open list tags has a space. It won't affect how the browser renders the page, but it's good to have uniform code.

6.) Firefox does a better job that IE interpreting poor code with what you intend it to do. In addition, IE poorly conforms to web standards. You can use a tool like W3C's Markup Validator ( to help keep your syntax up to standards.

Apologies if I don't respond to your reply immediately. I don't check this site daily.

Report •

February 16, 2011 at 21:16:25
Thanks for the reply. I just went thru ur suggestions and here is wat i found:

1.&2. This is the first time i was using this forum, so I pasted the code directly here rather than using the pre tags and hence anchor tags does not appear closed and i had to put ellipses so that the anchor tags itself would display.

3. I have used '../' since the folders and files are local. No matter where its saved, i need to access it from the root. Moreover, the exact url appears in the status bar, when i hover over the links. So i guess, the links should be proper.

4. I followed your suggestion and now the whole website has the same style(cases).

5. The space was a typo.

Code sample(Now since i used the pre tags, hopefully the code appears the way it is meant to be):

<ul id="treemenu1">
     <li><a href="index.htm">Home</a></li>
     <li><a href="../businessgroups/index.htm">Business</a>  
            <li><a href="../businessgroups/index.htm">Prodcuts</a>   
            <li><a href="../businessgroups/services.htm">Services</a>  
            <li><a href="../customers/customers.htm">Customers</a></li>    
            <li><a href="../contact/contact.htm">Contact</a></li>   

I still have the same issue.. can there be any other reason?

Report •

February 17, 2011 at 10:47:17
I found it odd when I first joined, too. Most forums use BBCode, but this forum allows HTML.

All your links are to files with a .htm extension. Did you make sure you saved all the HTML files as .htm, or did you save some as .html? That would account for some links not working. You can either change the extension from Windows Explorer (not IE) if you're not hiding file extensions in the Folder Options, or you can re-save each file and delete the old version.

Apologies if I don't respond to your reply immediately. I don't check this site daily.

Report •

February 18, 2011 at 21:27:54
All my files are saved as .htm files. I even tried re-saving all the files... it just do not happen to work :( I better take a break now and will get back to it laterrrr !!!!

Anyway, thanks for ur suggestions and views!
Much appreciated!

Report •

February 18, 2011 at 23:15:28
You said the pages are local, meaning they're on your hard drive and not a web server. Are you running these in a development web server like WampServer or XAMPP, or are they in an ordinary folder? The reason I ask makes the difference between using a slash (/) and a backslash (\) in the URL.

If it's an ordinary folder, the URL would look something like this:


If on a web server, the URL will look something like this:


If this isn't the issue either, then I'm stumped. All I would suggest is to use absolute links instead of relative ones.

It appears like you're building a site menu, so relative links wouldn't work anyway. They'd always be relative to the page you're viewing, but you could be viewing the site at different depths.

For example, if you're at the homepage and going to the Business Groups link, you're linking to a page that is higher in the hierarchy than the homepage itself.

After you've managed to get to the Business Groups page, you click home and end up reloading the Business Groups page because it's not specified to a different folder and both the Business and Homepage have the same file name.

You're still on the Business Groups page and you click the Services page. Once again, you go higher in the hierarchy.

Instead of your directory looking something like this:

Your directory looks more like this, and could be drastically different depending on which order you click links:
/index.htm (Homepage)
/businessgroups/index.htm (Business groups page)
/businessgroups/index.htm (Business groups page, intended to be homepage)
/businessgroups/businessgroups/services.htm (A directory that likely doesn't exist)

Apologies if I don't respond to your reply immediately. I don't check this site daily.

Report •

Ask Question