Browser & Web Performance · Middle · Question 8 of 75
Which change usually causes only a repaint, without layout?
- 1Changing
width - 2Adding an element to the DOM
- ✓Correct answer: Changing
background-color
Explanation
Color doesn't change geometry, so layout is skipped, but pixels must be repainted. Geometry and DOM changes trigger layout.