Interview Question

What is padding in CSS?

Padding creates space inside the border around content.

💡 Concept ✅ Quick Revision 🎨 CSS

Answer

Padding is space between an element’s content and border. • The element’s background is painted behind its padding. • Padding cannot use negative values. • Percentage padding is resolved using the containing block’s inline size.

💡 Simple Example

.button { padding: .75rem 1rem; }

⚡ Quick Revision

Padding creates space inside the border around content.