0

I have a lot of errors in validator but I don't know why. My code looks fine. I have errors: Start tag a seen but an element of the same type was already open. and: Stray end tag a. And here is my code:

<a href="/catalog/tonometri_2"><a class="sub-link"  href="/catalog/tonometri_2">Tonometers</a></a>

<a href="/catalog/ingalyatori_nebulayzeri"><a class="sub-link"  href="/catalog/ingalyatori_nebulayzeri">Inhalers</a></a>

Can I use tag a inside a?

Vlad
  • 91
  • 1
  • 1
  • 6
  • Please read: http://stackoverflow.com/questions/3379392/what-elements-can-be-contained-within-a-a-tag – keziah May 16 '16 at 08:45

1 Answers1

6

No. Every version of HTML forbids the nesting of anchor elements.

The current spec says:

Content model: Transparent, but there must be no interactive content descendant.

And it defines "interactive content" as:

Interactive content is content that is specifically intended for user interaction.

a audio (if the controls attribute is present) button embed iframe img (if the usemap attribute is present) input (if the type attribute is not in the hidden state) keygen label object (if the usemap attribute is present) select textarea video (if the controls attribute is present)

Note that it includes <a> at the start of that list.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335