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 trial

HTML

Isn't it bad to have <a> outside of <p>?

I learned a little bit of html before starting treehouse, and I remembered that the rule of thumb was to have <a> always inside of block elements such as <p>, yet in the videos, <a> is always put on the outside. What's the reasoning?

1 Answer

Angela,

This is really about a change that happened in HTML5 making it semantically appropriate to treat links at a block-level if deemed appropriate by the markup and thus removing duplication.

See: http://html5doctor.com/block-level-links-in-html-5/