Image styling improves consistency and polish while preserving intrinsic media meaning and performance.
Common image styles
- Border radius and subtle shadow.
- Object-fit for consistent card crops.
- Responsive max-width behavior.
Production checklist
- Keep aspect ratio predictable where layout stability matters.
- Avoid filters/effects that reduce informational clarity.
- Validate at multiple viewport widths and DPRs.
Important interview questions and answers
- Q: Why
max-width: 100%on images?
A: Prevents overflow in fluid containers. - Q: Why set explicit width/height in HTML too?
A: Reserves layout space and reduces CLS before image paint. - Q: Common gallery image issue?
A: Inconsistent crop/framing without object-fit strategy.
Practice: Change one property in the playground and observe cascade + layout in DevTools.