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
Carlos Favela
5,325 PointsHow to make a whole div clickable?
I remember Nick showed us in a tutorial on how to accomplish this, but I can't seem to find it. From what I recall, it doesn't require JavaScript.
What I have is a div with a link inside, but I want to make the whole div clickable like a button.
Carlos Favela
5,325 PointsThis is what I have
1 Answer
Brandon Byus
2,676 PointsYou should be able to just wrap the div in an anchor tag "<a>" and it will turn the div into a link
John Locke
15,479 PointsAlso make sure that anchor tage is display: block, width: 100%,
James Barnett
39,199 PointsJames Barnett
39,199 PointsShow us what you've got so far by creating a demo using codepen