Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAdam Dingle
5,582 PointsAnchor Tags
I noticed that when we first used anchor tags they were entered outside the <h1> tags, but in the list they were included inside the <li> tags. Is there a reason for this or can they be used either way?
2 Answers
Jonathan Grieve
Treehouse Moderator 91,253 PointsInside list element is best practice as it's inside a list item that you'd put your link and its text.
So this is best practice.
<ul>
<li><a href="#">Link text</a></li>
</ul>
But this is also best practice.
<a href = "#"><img src = ""></a>
Lady Do While
6,027 PointsYes, the video doesn't reflect best practice as it wraps two heading elements (block elements) in an anchor (in-line). I am using this video for review and that was difficult to watch.