Reputation: 31343
Can someone explain the difference between 'block' and 'inline-block' for the CSS display setting?
Upvotes: 8
Views: 11898
Reputation: 5159
This is a wonderful detailed article about this topic: What’s the Deal With Display: Inline-Block?
Upvotes: 0
Reputation: 587
inline-block treats the element like other inline elements but allows the use of block properties.
Elements with display: block take up as much width as they are allowed and typically start on a new line.
Upvotes: 5
Reputation: 6857
Basically, it’s a way to make elements inline, but preserving their block capabilities such as setting width and height, top and bottom margins and paddings etc. For example:
(Source: http://www.impressivewebs.com/inline-block/)
Upvotes: 15