1

I have the following html structure in my VF page (docType="html-5.0"):

<a class="outer">
    <span>Some text</span>
    <span><a class="innerLink"></a></span>
</a>

But in browser this is different:

<a class="outer">
    <span>Some text</span>
    <span></span>
</a>
<a class="innerLink"></a>

I am using innerLink for downloading pdf, and it has to be in span because span also contains image. innerLink is outside of span because of unknown reason. Why is this happening?

1

I believe the problem is that nested links are illegal. For an html5-specific reference:

Interactive content, e.g. a, button, label. Interactive content is not allowed to be nested.

There must be a way that you can put it in a span outside of that other <a> tag, maybe something like this:

<a class="first">
    <span>Some text</span>
</a>
<span><a class="otherLink">Some other text</a></span>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.