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

Development Tools

Shaun Russell
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Shaun Russell
Front End Web Development Techdegree Graduate 18,510 Points

When refactoring a site for accessibility, is it OK to have an img element nested within an anchor element?

I am using the Audit tab within the chrome developer tools to run a test for the accessibility of my site. One of the warnings it gave me was that my anchor tag was blocking my image. Is this a problem?

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hey Shaun,

Personally, I don't see a problem with images nested inside of anchors. I've done this many times to have the image be 'clickable' for the link (which I feel makes the UI much better). So, in my opinion, I would not worry about the 'so-called' error you are receiving.

:)