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>
</a>

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.

Thanks

AJ
LVL 4
arataniAsked:
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.

DaydreamsCommented:
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>
0
neesterCommented:
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:

table:hover
{
CODE HERE
}
0
neesterCommented:
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.
0
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.

AJ
0
DaydreamsCommented:
>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.
0
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>
</span>

The style sheet is,

span.menu:hover {

 
}

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.

Thanks

AJ
0
DaydreamsCommented:
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:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<style type="text/css">
a.menu:hover {background-color:#ff0000; }  /*for example*/
</style>
</head>
<body>
<table><tr><td>
<a class="menu" href="page1.html"> Page 1 </a></td>
<td><a class="menu" href="page2.html"> Page 2 </a></td>
</tr>
</table>
</body>
</html>
0
neesterCommented:
YES you can make it work with a LITTLE javascript code.
Look at this website:

http://www.htmldog.com/articles/suckerfish/dropdowns/

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

Look at these example pages:
http://www.htmldog.com/articles/suckerfish/dropdowns/example/
http://www.htmldog.com/articles/suckerfish/dropdowns/example/vertical.html

Very easy to adapt to any website!
0

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
HTML

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.