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 CSS Layout Techniques Display

inline-block

any help...?

2 Answers

Inline elements:

respect left & right margins and padding, but not top & bottom cannot have a width and height set allow other elements to sit to their left and right. see very important side notes on this here. Block elements:

respect all of those force a line break after the block element acquires full-width if width not defined Inline-block elements:

allow other elements to sit to their left and right respect top & bottom margins and padding respect height and width From W3Schools:

An inline element has no line break before or after it, and it tolerates HTML elements next to it.

A block element has some whitespace above and below it and does not tolerate any HTML elements next to it.

An inline-block element is placed as an inline element (on the same line as adjacent content), but it behaves as a block element.

thank you Colin appreciate your help....