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 trialChristopher Neal
833 PointsUsing " id='top' " Opposed To " name='top' "
Is there much of a difference between using "id" or "name", for example when naming the header "id=top"? The only difference I can see is when using "id", the link after the footer takes you to the top of the element and when "name" is used, it takes us to the top of the body.
2 Answers
Andrew Dushane
9,264 PointsThe name attribute is an older way of doing it that's not supported in HTML5. You want to use id because it's the current, accepted way to do it.
Christopher Neal
833 PointsAhh, thanks Andrew.
Andrew Dushane
9,264 PointsAndrew Dushane
9,264 PointsAlso it lets you anchor and style an element with one attribute rather than two, which I'm guessing is why it's the recommended way.
Andrew Dushane
9,264 PointsAndrew Dushane
9,264 PointsHTML5 obsolete features: http://www.w3.org/TR/html5/obsolete.html