Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML How to Make a Website Adding Pages to a Website Add Iconography

Why did we apply display block to '.contact-info a'... Why not use inline-block? What's the difference!? I am confused

.contact-info a { display: block; /* display is block, so that it will take up space? */ }

Can anyone please explain why we do this, and why use block over inline-block... Nick says its used so that it will take space. Can anyone elaborate please? Thanks

1 Answer

Steven Parker
Steven Parker
220,925 Points

Explicit size settings are ignored on flowed elements, that's the reason to set the display mode. Of course, flowed elements still "take up space", but you can't control that space the same way. I'm not sure, but perhaps that's what he meant.

A value of "inline-block" would be a good choice if you wanted the items to share the same line, but in this case "block" is chosen to place each one on a separate line.