Interview Question

What are inline-block elements?

Inline-block combines inline placement with block-like sizing.

💡 Concept ✅ Quick Revision 🌐 HTML

Answer

An inline-block element sits in a line but can have a set width and height. • It can appear beside other inline or inline-block items. • Unlike a normal inline element, box dimensions work more directly. • This behavior is usually created with CSS.

💡 Simple Example

<span style="display:inline-block;width:120px">Badge</span>

⚡ Quick Revision

Inline-block combines inline placement with block-like sizing.