John Livermore
John Livermore

Reputation: 31343

What does inline-block mean for css?

Can someone explain the difference between 'block' and 'inline-block' for the CSS display setting?

Upvotes: 8

Views: 11898

Answers (3)

Amr
Amr

Reputation: 5159

This is a wonderful detailed article about this topic: What’s the Deal With Display: Inline-Block?

Upvotes: 0

Coronus
Coronus

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

Rodney Folz
Rodney Folz

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:

Inline-block demo

(Source: http://www.impressivewebs.com/inline-block/)

Upvotes: 15

Related Questions