HTML Guide
An <a>
tag can’t include other <a>
tags inside. Most probable cause is an unclosed <a>
tag, like in this example:
<a href="one.html">Page 1
<a href="two.html">Page 2</a>
Related W3C validator issues
An </a> end tag has been found to violate nesting rules. <a> tags can’t include other <a> tags inside. Most probable cause is an unclosed <a> tag, like in this example:
<a href="one.html">Page 1
<a href="two.html">Page 2</a>
A <button> tag can’t include other <button> tags inside. Most probable cause is an unclosed <button> tag, like in this example:
<button>Submit
<button>Cancel</button>
The <iframe> HTML element represents a nested browsing context, embedding another HTML page into the current one.
As the iframe is a container that holds an embedded HTML page, it cannot be nested inside an a tag.
An <input> tag can’t be used inside an <a> tag.
A <label> tag can’t be used inside an <a> tag. Consider using other tags like <span>.
A <textarea> tag can’t be used inside an <a> tag.
A button element, or an element with the role=button attribute, is not allowed to be nested inside an <a> element.
An <a> element cannot contain a descendant element with the attribute tabindex.
The href attribute of an <a> element contains an invalid character, that should be properly encoded as a URI percent-encoded character.
The target attribute on <a> elements can’t be blank.
This attribute defines the browsing context for links, that is, where should the linked documents be opened. This was used extensively on the now deprecated <frame> element, so you could give the name of the frame to open the document in, but is now more used to force links to open in a separate tab or window using target="_blank". Another option is using a name, so the new browsing context can be referred to on subsequent clicks on links with the same target.
For example, this will force the links to open on a new tab:
<a href="https://example.com" target="_blank">will open a blank tab</a>