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

CSS CSS Layout Techniques Display Modes Inline-Block Formatting

Atlas AKIN
Atlas AKIN
1,675 Points

Making Logo Clickable

I didn't follow properly how to make the link logos clickable(all parts of the button).

What was the effect of using display: block and what was the effect of giving paddings to the links?

1 Answer

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

Well adding Padding and margins to links make them easier to interact if you're using a mobile or touch screen device, so using padding on links should be encouraged. :-)

But to make an image like a logo clickable simply takes code like this..

<a href="">
   <img src ="" />
</a>

Simply by wrapping an image element in anchaor tag it surrounds the entire image and makes it clickable. Be sure to put a border: none; rule in your CSS to remove any default styling.

Hope this helps,