Loading

Quipoin Menu

Learn • Practice • Grow

css / padding in CSS
interview

Q1. What is padding in CSS?
Padding creates space inside an element, between the content and its border.

Q2. How is padding different from margin?
Padding is inside the border (affects element's interior), margin is outside (affects spacing between elements).

Q3. How can you set padding for different sides?
Use padding-top, padding-right, padding-bottom, padding-left individually, or shorthand padding with 1-4 values.

Q4. What does padding: 10px 20px mean?
Two values apply: first = top/bottom (10px), second = left/right (20px).

Q5. Does padding affect element dimensions?
Yes, padding increases the total width/height unless box-sizing: border-box is used.