Anchor within anchors

I was wondering if this is possible,

<a href='page1.html'> Page 1
   <table><tr><td><a href='page2.html'> Page 2 </a></td></tr></table>

I need this to work since I have this menu system built using CSS. However, when I hover over the second page the status bar still says page1.html. If I click the second link then it gives me page2.html in IE, but page1.html in Netscape?

I have to keep this structure. Any suggestions on how to make this work (preferably without using any javascript). If I get a good quick answer, I'll increase the points for the person.


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hi aratani,

You need to close the anchor tags properly:

<a href="page1.html"> Page 1</a>
   <table><tr><td><a href="page2.html"> Page 2 </a></td></tr></table>
No that is not possible.
you cannot have a block elemtnt like a table, inside an inline element like an anchor.

Basically - No you cant.
I am guessing you want a hover effect when you hover over the table?
Using CSS, this can be done:

Sorry I just realise how much that didn't make sense.

No You cannot have your code structured like that.
A table is a BLOCK level element.
Which cannot reside inside an INLINE element.
An Anchor is an INLINE element.

Your code is invalid HTML, and will produce unsavoury results in most browsers.
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

arataniAuthor Commented:
Well, the menu system right now works perfectly. Actually, the table within the anchor do show up as a table in all the browsers I've tested. :). But, I can't get the link in Page2 to connect. It still thinks we are in the anchor for Page1. I was just wondering if there was a way to get the link in Page2 to work.

>It still thinks we are in the anchor for Page1.

It is because you closed the a tag after the table. As Neester said, it is invalid code.
arataniAuthor Commented:
Okay, I get that. But, now I have a newer problem and I don't know if I can ask that up here. But, to make my menu's work, I have used the hover element. However, the hover doesn't work for IE (for anything except the anchor tag). Is there someone who can give me a way to make the hover work for IE.

For example,

<span class='menu'><a href='page1.html'> Page 1 </a>
   <table><tr><td><a href='page2.html'> Page 2 </a></td></tr></table>

The style sheet is, {


This works for Mozilla and Netscape, but not for IE.

Can someone tell me how to make it work for IE? I will reward them with points.


Hi aratani,

You can't put a block level element like a table inside a span tag. I don't see the necessity of the table, but you could put the links in td's if you like:

<style type="text/css"> {background-color:#ff0000; }  /*for example*/
<a class="menu" href="page1.html"> Page 1 </a></td>
<td><a class="menu" href="page2.html"> Page 2 </a></td>
YES you can make it work with a LITTLE javascript code.
Look at this website:

You wont need to HACK it up with invalid code etc...

Look at these example pages:

Very easy to adapt to any website!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.