Does HTML allow nested links?

Last Update: Apr 26 2024 | BY: Minakshi Jha

A

Anurag Mishra

No, HTML does not allow nested links, Links and anchors defined by the A element must not be nested; an A element must not contain any other A elements. 

Since the DTD defines the LINK element to be empty, LINK elements may not be nested either.

See the below example, this is not allowed in HTML

<a href="#">

    <a href="#" >Link 1</a>

    <a href="#" >Link 2</a>

</a>

The above example is not valid, nested links are not allowed in HTML

0 votes

Your Answer

Email Us: advertise@gdatamart.com

Donate Us: Support to GDATAMART

LifeStyle & Fun

© 2024 GDATAMART.COM (All Rights Reserved)