Interview Question

What is inline-block?

inline-block flows inline while allowing block-like sizing.

💡 Concept ✅ Quick Revision 🎨 CSS

Answer

inline-block creates an inline-level box containing a flow-root box. • It sits in an inline formatting context like text. • Its width and height can be sized like a block container. • Whitespace between inline-block boxes can create visible gaps.

💡 Simple Example

.tag { display: inline-block; padding: .25rem .5rem; }

⚡ Quick Revision

inline-block flows inline while allowing block-like sizing.