Padding adds inner space between content and border, improving readability and touch target comfort.
Practical rule
Use consistent padding scales (for example 8/12/16/24px equivalents) across components.
Rendered output
Important interview questions and answers
- Q: Padding vs margin in one sentence?
A: Padding is inside border; margin is outside border. - Q: Why is padding important for buttons?
A: It improves hit area and perceived affordance. - Q: Can percentage padding be useful?
A: Yes, especially for responsive aspect-ratio techniques.
Pitfall: Check cascade order—author stylesheet loses to inline styles and !important surprises.