← TechnologyThe essentials of

Background-size: cover fills with possible cropping

Publisher: ResumeMaker • 1 source

Published: 23 Oct 2026 08:23 · Updated: 23 Oct 2026 08:23

AI source check: 22 Oct 2026 16:54. This is not editorial approval.

In a few sentences

In brief

background-size controls a background image's size. cover fills the area while preserving proportions, but may place parts outside it; contain fits the entire image.

Useful to know

background-size controls a background image's size. cover fills the area while preserving proportions, but may place parts outside it; contain fits the entire image. [1]

For a portrait, check different container proportions. If an important detail disappears, consider size and position together. A successful wide crop does not guarantee the same result on a phone.

Sources

For further detail and to check the information:

  1. [1] MDN — CSS background-size ↗