Technical Documentation Project, <li> inside <a>

Technical Documentation Project, <li> inside <a>
0
#1

Hello!

I’m working on the Technical Documentation Project, when I came across this HTML in the example:

<ul> 
    <a class="nav-link" href="#Introduction" rel="internal"><li>Introduction</li></a>
    <a class="nav-link" href="#What_you_should_already_know" rel="internal"><li>What you should already know</li></a>
</ul>

Shouldn’t the the anchor be included within the list item? I think I remember reading on Codecademy that anchors must be included within the list item because the only child to a ul should be a li. Is this rule obsolete? Or are there exceptions to the rule? If not, maybe the HTML in this example should be updated, because others newbies like me might be a little confused.

#2

Yeah, that’s not the correct way to get the desired effect they are after.

See: https://stackoverflow.com/questions/16211326/could-i-use-a-in-ul-around-li

1 Like
#3

Hi @busyhero, good catch! An issue (issue # 35624) has been opened against this. The only reason I know off-hand is because I opened the issue.

I know they are working on updating everything in fCC and this issue is one of the updates that will be included.

1 Like