Solved

Link inside a link

Posted on 2002-06-10
9
239 Views
Last Modified: 2010-04-09
I have some text that is all one link to one page, but if a user edits it and puts a link inside the text somewhere, the first part of the text still links to where it supposed to go, but the rest just becomes text.  I'm assuming that the second link inside the text closes the first a href and itself.  My text looks something like this:

"<a href="page1">Text with a link and a second <a href="page2">Link</a> and it doesn't work</a>"

Please help.

Thank you in advance.
0
Comment
Question by:cpalacios
[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
9 Comments
 
LVL 2

Expert Comment

by:Marianne
ID: 7067610
You just have to avoid this situation. Nothing else can be done.

12.2.2 Nested links are illegal
Links and anchors defined by the A element must not be nested; an A element must not contain any other A elements.

http://www.w3.org/TR/html401/struct/links.html#edef-A
0
 
LVL 18

Accepted Solution

by:
bruno earned 50 total points
ID: 7067887
you can't nest links like that...you would have to do this...


<a href="page1">Text with a link and a second</a> <a href="page2">Link</a><a href="page1"> and it does work</a>
0
 
LVL 19

Expert Comment

by:webwoman
ID: 7068390
Why/how are your users editing the links? How are they even creating this nightmare?
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 12

Expert Comment

by:lexxwern
ID: 7068889
<a> tags cannot be nested, some freak browser may allow that but dont (im sure this would have been said above)/.

but /you can get what you want with just simple <a href>'s.
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 7069438
Just think, does it sound logical to you to have one link actually be two links? The users will probably never even find that link...Why? If it where possible, the two links, would look as one link, so the user would have to accidentaly see that there are in fact two different links...

And yes, the way brunobear told you, is the way to go, if you really want to do so....

Max.
0
 
LVL 18

Expert Comment

by:bruno
ID: 7146414

Hello,

This question has been open for quite a while now and needs to be wrapped up.

EXPERTS: If any of the experts could come back and post any suggestions as to how they feel this could be wrapped up (delete, 0 PAQ, award points, etc), I'm sure the moderators would appreciate it.  If you feel you deserve points here, but don't care to respond, the question might very well get DELETED.

ASKER:  Please return and finalize this question.  Abandoning a question is in violation of the member agreement.

Please do NOT accept this comment as an answer, as I am simply trying to alert those involved that the question is still open.

Thank you,

BRUNO
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 7146456
Split leveret and brunobear.

leveret was the first to say it is not allowed according to W3C rules, and brunobear was the first to provide a workaround..

My two cents,
Max.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7182465
It is time to clean this abandoned question up.  

I am putting it on a clean up list for CS.

<recommendation>
split leveret and brunobear

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&
0
 
LVL 1

Expert Comment

by:Computer101
ID: 7182909
Comment from expert accepted as answer.  Bruno, look for your question in this topic area

Computer101
E-E Moderator
0

Featured Post

Technology Partners: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Do alert on select 6 26
CSS Style Effect 2 18
What cart is this? 2 34
Read text on Table 7 27
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
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.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

749 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