Performance: Background repeat
MEDIUM IMPACT
Background repeat affects how the browser paints repeated images, impacting paint time and memory usage.
body {
background-image: url('pattern.png');
background-repeat: no-repeat;
background-size: cover;
}body {
background-image: url('pattern.png');
background-repeat: repeat;
}| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| background-repeat: repeat with large image | Minimal | 0 | High due to many repeated paints | [X] Bad |
| background-repeat: no-repeat with scaled image | Minimal | 0 | Low paint cost with single image | [OK] Good |