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 Basics (2014) The Box Model Display Values

rajbee
rajbee
6,657 Points

How do you achieve the effect of inline block without using inline block ?

How do I do it ? Please show me some code.

2 Answers

Gunhoo Yoon
Gunhoo Yoon
5,027 Points

First of all, why are you trying to achieve inline-block without using inline-block?

My questions aside, you can achieve limited fake version by adjusting padding and margin of inline element explicitly. But this is just not worth your time. It doesn't even suit for learning purpose.

Alternatively you write your own CSS-like language using other programming languages which is beyond my scope.

Julian Aramburu
Julian Aramburu
11,368 Points

Hi Raj! As far as I know you must use inline-block just because inline elements can't use margin properties. That's why sometimes you use inline-block, because you need the inline effect but also needs to adjust margin.