Interview Question

What is border in CSS?

A border surrounds the padding box and contributes to element size.

💡 Concept ✅ Quick Revision 🎨 CSS

Answer

A border is a line drawn around an element’s padding edge. β€’ Border width, style, and color can be set independently. β€’ A border contributes to the box size. β€’ Rounded corners are controlled separately with border-radius.

💡 Simple Example

.avatar { border: 3px solid royalblue; border-radius: 50%; }

⚡ Quick Revision

A border surrounds the padding box and contributes to element size.